My favourite books of 2013

In 2013 I finally started using Goodreads to track the books I read. In total I read 53 books and I’ve listed a few of my favourites below.

The Company of the Dead (by David Kowalski)

The Company of the Dead

Can one man save the Titanic?

March 1912. A mysterious man appears aboard the Titanic on its doomed voyage. His mission? To save the ship.

The result? A world where the United States never entered World War I, thus launching the secret history of the 20th Century.

The Company of the Dead is David Kowalski’s first book. Personally I thought it was extremely good, I think I went read the entire 750 page book in under a week.

Pirate Cinema (by Cory Doctorow)

Pirate Cinema

When Trent McCauley’s obsession for making movies by reassembling footage from popular films causes his home s internet to be cut off, it nearly destroys his family. Shamed, Trent runs away to London. A new bill threatens to criminalize even harmless internet creativity. Things look bad, but the powers-that-be haven’t entirely reckoned with the power of a gripping movie to change people’s minds…

If you didn’t care about copyright, patents, fair use and such before, you will after reading Pirate Cinema.

Little Brother (by Cory Doctorow)

Little Brother

Marcus, a.k.a “w1n5t0n,” is only seventeen years old, but he figures he already knows how the system works–and how to work the system. Smart, fast, and wise to the ways of the networked world, he has no trouble outwitting his high school’s intrusive but clumsy surveillance systems.

But his whole world changes when he and his friends find themselves caught in the aftermath of a major terrorist attack on San Francisco. In the wrong place at the wrong time, Marcus and his crew are apprehended by the Department of Homeland Security and whisked away to a secret prison where they’re mercilessly interrogated for days.

The truly scary thing about Little Brother (and its sequel, Homeland) is how believable the events that it describes are. Everyone should read this book.

Spin (by Robert Charles Wilson)

Spin

One night in October when he was ten years old, Tyler Dupree stood in his back yard and watched the stars go out. They all flared into brilliance at once, then disappeared, replaced by a flat, empty black barrier. He and his best friends, Jason and Diane Lawton, had seen what became known as the Big Blackout. It would shape their lives.

While the setting for Spin might be considered “sci-fi”, the story itself is more about the humans living through these events. A truly excellent book.

Consider Phlebas (by Iain M. Banks)

Consider Phlebas

The war raged across the galaxy. Billions had died, billions more were doomed. Moons, planets, the very stars themselves, faced destruction, cold-blooded, brutal, and worse, random. The Idirans fought for their Faith; the Culture for its moral right to exist. Principles were at stake. There could be no surrender.

2013 was the year that Iain M. Banks died and the year that I finally got around to reading his works. Consider Phlebas is the first book in his Culture series and, in my opinion, a good place to start reading his books.

Radical Brewing (by Randy Mosher)

Radical Brewing

History, humor and homebrewing converge when the creative and prolific mind of Randy Mosher explores the expressive side of beer in Radical Brewing.

In late 2013 I started a new hobby: beer making. Radical Brewing is only beer making book I’ve bought so far (though I read the online version of John Palmer’s How to Brew) and it was most excellent.

Masters of Doom (by David Kushner)

Masters of Doom

Masters of Doom is the amazing true story of the Lennon and McCartney of video games: John Carmack and John Romero. Together, they ruled big business. They transformed popular culture. And they provoked a national controversy. More than anything, they lived a unique and rollicking American Dream, escaping the broken homes of their youth to produce the most notoriously successful game franchises in history—Doom and Quake— until the games they made tore them apart. This is a story of friendship and betrayal, commerce and artistry—a powerful and compassionate account of what it’s like to be young, driven, and wildly creative.

Masters of Doom should be required reading for anyone who has ever played Doom, Quake, or any other game from id Software.

The senz° smart s umbrella

senz° smart s

Recently I started looking for a replacement for my current umbrella (some random model that I purchased from a brick and mortar store) and after much toing and froing I settled on the senz° smart s.

I’ve had the umbrella for a couple of days now, and so far I’ve been extremely satisfied. The construction seems solid and it has performed well in the wind conditions I’ve experienced so far.

All bottled up…

All bottled up…

Labels for my Ilves IPA

Labels for my Ilves IPA

Time to do something about validate & validates?

I think it’s about time we did something about the validate and validates methods in ActiveModel.

Having two methods with such similar names that do similar things but in a totally different way is extremely confusing. What’s more, if you do use validate instead of validates by mistake, no exceptions are raised and MyModel.valid? will return true.

I have trouble remembering which one I should be calling, and I’ve been working with Rails for years now. I can’t imagine how confused a novice programmer would be…

Perhaps renaming validate would be the way to go (with proper deprecation warnings, of course)?

Adapted from a message to the Ruby on Rails: Core mailing list, all constructive discussion should happen there.

New Yorker cover story: Nelson Mandela

New Yorker cover story: Nelson Mandela

(December 16th, 2013)

Mandarin liqueur

Mandarin liqueur

12kg of malt and more

12kg of malt and more

Yup, that’s 12kg of malt, hops, and other stuff like that…

My mandarin liqueur is on the way!

My mandarin liqueur is on the way!

Middleman on Heroku (with Nginx)

nginx ❤️ Middleman

⚠️ This article is outdated, please see the Middleman on Heroku – 2017 edition post for a more up to date guide on how to deploy Middleman sites to Heroku.


In my last blog post about Middleman on Heroku, Middleman was configured to be served via the Puma application server.

By following this guide, you can setup your middleman site to be served by Nginx, which should be a lot more robust for static sites. If you already have a Middleman site in a git repo, you can skip the first few steps.

Install Middleman (if you haven’t already):

gem install middleman

Create a new Middleman site (and change into that directory):

middleman init beer_catalogue
cd beer_catalogue

Initialise the git repository and commit everything:

git add .
git commit -am "Everything"

Create a new Heroku app (if you omit the name Heroku will generate one for you):

heroku create beer-catalogue

Configure Heroku to use the multi-buildpack (with the Nginx and Ruby buildpacks):

heroku config:set BUILDPACK_URL='https://github.com/ddollar/heroku-buildpack-multi.git'
echo 'https://github.com/ryandotsmith/nginx-buildpack.git' >> .buildpacks
echo 'https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz' >> .buildpacks
git add -f .buildpacks
git commit -m 'Add multi-buildpack'

Create a file called nginx.conf.erb in the config directory (create the directory if it doesn’t already exist) and give it the following contents:

daemon off;
# Heroku dynos have 4 cores.
worker_processes 4;


events {
  use epoll;
  accept_mutex on;
  worker_connections 1024;
}


http {
  gzip on;
  gzip_comp_level 2;
  gzip_min_length 512;


  log_format l2met 'measure#nginx.service=$request_time request_id=$http_heroku_request_id';
  access_log logs/nginx/access.log l2met;
  error_log logs/nginx/error.log;


  include mime.types;
  default_type application/octet-stream;
  sendfile on;


  # Must read the body in 5 seconds.
  client_body_timeout 5;


  server {
    listen ;
    server_name _;
    keepalive_timeout 5;
    root /opt/buildhome/build;
  }
}

In the root of your project, update create the Procfile with the following contents:

web: bundle exec middleman build && bin/start-nginx -f sleep infinity

Commit these changes:

git add .
git commit -am "Nginx configuration"

And finally, push your Middleman site to Heroku:

git push heroku master

Once the push completes, you should be able to access the app at yourappname.herokuapp.com

HTTP Headers

If you want to, feel free to edit the nginx and Middleman config files to suit your needs (e.g. add additional cache headers or turn on directory indexes).