The Latest

Avoiding the Worst Technical Debt

..or, how not to paralyze your future self.

When we talk about technical debt, we’re talking about paralysis. It means an organization can’t do something good today, because it handcuffed itself in the past with a poor decision.

There is nothing inherently bad about old code. Over time, coding styles, architectures, and environments may change, but code can often be operational and maintainable for a surprisingly long time. In many cases, tech debt is a treatable condition. It might slow you down, but it needn’t paralyze you.

More…

Explore the Russian Troll Tweet Dump

NBC has published a database of the deleted Russian troll tweets. There’s even a nifty graph database for exploring them, Neo4j.

But what if you want to explore the data in your own PostgreSQL database? Here is some SQL to create the database and tables, import the CSV files, and convert text data to more convenient formats:

https://github.com/SpencerAP/democracy_sql

Tested on PostgreSQL 9.3.21, may require adaptation to work with other RDBMSs or versions. Enjoy!

New Tool: SQL to CSV

I write a lot of SQL queries at work and, quite regularly, find myself exporting them to CSV files. PostgreSQL’s command line client, psql, has a command to handle this task – \COPY – that you can use to output the results of a SELECT statement to a local CSV file. It looks like this:

\COPY (SELECT * FROM foo) TO '~/output.csv' CSV

That works well, but it’s tedious to constantly convert commented, indented SQL into a one-line COPY command. Sure, I could create a macro in my text editor to handle this. Since I’m probably not the only person annoyed by this though, I created a simple tool anyone can use to automate the conversion: SQL to CSV. Give it a try!

Screenshot of SQL to CSV tool

Certbot Renewal Script

Now on GitHub: certbot-renew, my super-simple bash script for renewing Let’s Encrypt certs.

Polymer Binding Cheat Sheet

You shouldn’t have to read so many words in Polymer’s docs to figure out how to get the binding you want. Time is precious. There’s code to review. Your hair is turning gray. Use my cheat sheet instead!

More…