Andrew Timberlake Andrew Timberlake

Hi, I’m Andrew, a programer and entrepreneur from South Africa, founder of Sitesure for monitoring websites, APIs, and background jobs.
Thanks for visiting and reading.


Skipping blank lines in ruby CSV parsing

How to ignore blank lines when parsing a csv file with ruby's CSV parser.

12 Jul 2015

Append items to a sorted collection in Backbone.js

When an item is added to a collection in Backbone.js it should automatically be added to the corresponding list. When using a sorted collection it would be nice to have it appear in place, especially when not refreshing the entire list. That's what I'll explore in this post.

29 Jun 2015

Tip: View the SQL query behind psql commands

If you want to view the SQL query used to construct the information returned from a psql command (which will help you learn the underlying information schema) then …

14 May 2015

Unique constraint across two rows in PostgreSQL

You can use a unique index to ensure only one occurance of a value but what do you do if you want to limit uniqueness to two rows instead of one? PostgreSQL's partial indexing can help.

14 May 2015

Quote: Person responsible for my problems

“If I kicked the person responsible for most of my problems, I wouldn’t be able to sit down for weeks.”

11 May 2015

Looping with Fibers

I needed to loop over a fairly large data set and group it by year and month. In this post I walk through using two Ruby Fibers which communicate between each other in order to do in-loop grouping

9 Mar 2014

How to Add Subscribers to a MailChimp List With Ruby

An example of how to use the MailChimp API and their official mailchimp-api gem to add a subscriber to a mailing list.

11 Feb 2014

Potential security hole authorising modules in CanCan

Just some thoughts on how CanCan didn't work as I expected. Whether design or bug, it's worth checking out how modules are handled.

6 Nov 2013

How to protect downloads but still have nginx serve the files

Protect access to your files in Rails but still have Nginx serve the file efficiently

1 Dec 2010