PostgreSQL, gimme back my disk space!

One of the biggest mistake that I've made when I bought my current MacBook Air is to cheap out on disk space (128GB). Ever since, I have been fighting the good fight against running out of space.

I started using Disk Inventory X early on, as recommended...


Read more...

Identifying multiple instances of a polymorphic association in Rails

I recently had a problem which was solved by a polymorphic association and made things easy. Then came a twist: I needed model B to have a reference to two identifiable instances of A (polymorphic).

I'm having a hard time explaining what the problem is without an example so I hope that the rest of the post and examples will shed light on that.
Read more...

How to do peer reviews with middleman-blog

As I was writing my last post, I asked for help from a friend to choose a title. Middleman allows for posts to be for the development environment only with the published: false option, but it will not build the post when you run middleman build. What I really needed was a way to build the post and have it served in a public environment, but avoid having it being listed anywhere: RSS feed, sitemap, index page, etc.
Read more...

Build tools for yourself. Ship to the world!

A few weeks back I released 2 gems (for Rails) that I use almost on a daily basis. One of them is a simple backport of a Rails 4 feature and the other one is the way I prefer to write and test SQL queries.

They're not perfect by any stretch, they don't have tests and both could use some refactoring. I like to follow the lean startup approach and release minimum viable products before investing more time in them.
Read more...

How I made this blog fast with Middleman and NGINX

TL;DR; Static pages and caching.

A blog such as this one is so simple that I couldn't imagine hosting anything other than static pages. I'm using Middleman for this, a powerful static site generator written in ruby. It gives you access to things like sprockets as well as extensions like middleman-blog making it really easy to get started if you're familiar with the Rails stack.
Read more...