SQL Table Aliases are Identifiers Apr 18, 2021

A surprising thing to me working day-to-day is how often I still see queries that treat SQL table aliases purely as typing-saving shortcuts.

...
Copy less-Paged Text to Clipboard Apr 12, 2021 When viewing text in the pager less, it’s often handy to copy it to your clipboard. You can do this by typing (at the less prompt): |$ [clipboard-copy-program] You must do this from the first line of the output you want to copy, and this will copy all output to the end ($ is the automatic less mark for the end-of-file) For instance, on macOS you’d type: |$ pbcopy On Linux you’d use xclip or xsel: ...
Gnome: Enabling Hanyu Pinyin Input Apr 02, 2021

Or: how to reset your Gnome configuration with gsettings

...
Kotlin: Calling Extension Functions from Java Feb 19, 2021

Kotlin’s extension functions are a convenient way of attaching behavior to the most natural place it belongs. Extensions are incredibly handy to extend the behavior of classes you don’t control, or to define behavior that may only be useful to a subset of users of the class.

...
psql: Use ON_ERROR_ROLLBACK=interactive Jan 26, 2021

psql is a powerful command-line Postgres client that’s useful for both scripting, and to work with databases interactively.

When working interactively with a database, typos in transactions can be extremely annoying.

...
Vim: filter text with external programs Jan 02, 2021 One of the reasons Vim1 is powerful is that it gives you easy access to your shell. If you’ve invested in developing your skills with the Unix shell, and in writing shell-scripts, that work also pays off in Vim. Here’s a simple example that I use frequently: let’s say I find a slow SQL statement in my Postgres logs, and I’d like to rewrite it. To rewrite it, I first want to read it, so I’d like to turn this: ...
Vim, Orthogonality, and Software Design Dec 27, 2020

I learned Vim1 in my first programming job, when a senior engineer who loved Vim gave my group of new hires a few Vim basics intro sessions. I floundered at first, then got to the point where I could navigate Vim fairly fast. I could comfortably use Vim, but I didn’t really get Vim: I only got good enough at using it to make it work as well as any other (normal) text editor.

...
Quoting Strings in Postgres Dec 22, 2020

PostgreSQL offers multiple ways of quoting string literals. Most programmers are familiar with the first, but not the other forms.

...
Exported vs Un-exported Shell Variables Dec 21, 2020

Many programmers new to Unix shells are confused by shell variables, and how they relate to the Unix environment.

...
Constructor Injection is Good Design Dec 17, 2020

A key aspect of writing good code is asking for your dependencies as inputs, instead of hard-wiring references to your dependencies in the code, viz. dependency injection

...