PostgreSQL count_estimate() function for large tables and views

I once found all admin pages of a web app were taking 100ms longer than they should due to a count query on a huge table. I couldn’t remove the feature but as admins only needed a rough idea of how many rows there were I could substitute an estimate 🔮

Rails surprisingly executes DELETE on build_association

It was all the seemingly innocuous build_#{name}

Searching Discontinuous Dates in Elasticsearch using Lucene Expression Script

Elasticsearch is powerful, but very different to SQL and its scripting capabilities are limited in cloud hosting environments. This makes it appear impossible to use for certain sum of script and threshold queries—for example on discontinuous date ranges—but with some clever query structuring this can be done.

Designing a Font with Code

Years ago I started using a very simple SG made up of lines as my "logo". I evolved this over time and thought it would be even better if I had a whole font in the style of it. So here's how I created my personal font with code and refined my logo in the process.

why Ruby Symbol​#to_proc works, and more.()

Lets embark on a _why themed quest through Ruby's magical Symbol#to_proc. We will slay syntax dragons by deflating politicians, battle understanding with chrysanthemums, and journey further to cook up some funky fresh fish.

TIX Clock WIFI Hack

Years ago I got given a TIX clock. I like its stylish design and interesting way of representing time. Like a regular digital clock it tells time in hours and minutes, each broken up into tens and units. However instead of using characters it uses the corresponding number of lit up dots. To read the time you simply count the dots. It's slower to read, but a good conversation starter.

Case Insensitive Usernames with PostgreSQL citext

It's polite to refer to people by capitalising the first letter of their name (Joe Blogs). I think web apps should allow capitals in their usernames (JoeBlogs) too.

Enhancing Web UX Design Consistency with Sniffux

Which sides should I put my Cancel and OK buttons on? This is a question of the honourable subject, USER EXPERIENCE. Read on to find out that the answer is neither and both!