• Beer Styles 1.1.0 + BJCP 2015

    Version 1.1.0 of Beer Styles just hit the iOS App Store. The biggest new feature is that the BJCP 2015 Style Guidelines are now included!

    Beer Styles 1.1.0 on an iPad and iPhone 6

    The 2015 and 2008 beer, cider, and mead style guidelines from the Beer Judge Certification Program (BJCP).

    The style guidelines describe what each style of beer, cider, and mead should taste, look, and smell like.

    The guidelines include vital stats such as OG (original gravity), FG (final gravity), IBU (bitterness), SRM (colour), and ABV readings as well as descriptions for aroma, appearance, flavour, and mouth feel.

    In Beer Styles all the vital stats have been given a visual representation to make it easier to fathom how differences in styles.

    Download on the App Store

  • Bad Tidings

    Bad Tidings is a beer made from a bunch of leftover malts I had accumulated. I decided to try for a Belgian style beer largely because the Belgians seem to have a pretty relaxed attitude about what adjuncts they use, plus it gave me a chance to try out the Fermentis T-58 (PDF link) yeast.

    I chose the name Bad Tidings because I wanted to invoke a certain sense of dread or foreboding with the name (as it was unsure whether the beer would turn out to be any good at all).

    For this label I went with a bit of a literary theme because Bad Tidings sounds like the title of an 18th or 19th century novel in my head. The sole typeface is Adobe Caslon Pro, chosen mostly of how it looks but also because Caslon seemed to be historically accurate for the 18th century.

    “Practically all American and English printing from 1735 to 1800 was done using the Caslon font.” (source)

    As for the beer itself, the small sample I tasted while bottling seemed pretty good but I’ll have to wait a couple of weeks for it to bottle condition before rendering a final verdict.

    Bad Tidings label

  • The Summoning Dark

    The Summoning Dark is my first Black IPA, it’s named after a character in Thud!, a book by Terry Pratchett (if you can call a pan-dimensional creature and spirit of vengeance a character).

    For the main graphic of the label I used the mine sign rune for the Summoning Dark (described in the book as “a floating eyeball with a curly tail”). The beer name itself is in a rune-like typeface. The labels are stamped with my brewery stamp.

    The beer itself came out quite well, though on the brew day I worried about the colour coming out too light, but that turned out to be a false alarm in the end.

    As an attempt to minimise the “roasty” flavours from the Carafa Special II, instead of mashing it with the rest of the grains, I cold steeped it overnight in about two litres of water. I filtered out the malt from the water and added it to the wort before beginning my boil.

    In the end I think the beer got approximately the right about of the roasted flavours, but I it could have been more heavily hopped (especially in terms of aroma).

    The Summoning Dark

  • An improved email address validator

    For the last couple of years we’ve mostly used Devise’s extremely simple email address regex to validate email addresses. After all, the real proof of whether an address is correct is if the confirmation email gets through to the end user…

    # Email regex used to validate email formats. It simply asserts that
    # one (and only one) @ exists in the given string. This is mainly
    # to give user feedback and not to assert the e-mail validity.
    config.email_regexp = /\A[^@]+@[^@]+\z/

    If you haven’t read it already, you should read David Celis’s Stop Validating Email Addresses With Regex blog post for a more detailed explanation of why you shouldn’t validate email addresses with regexes.

    The downside of this regex is that it can and will let through email addresses that raise Mail::Field::ParseError exceptions once Mail actually tries to parse them.

    For example, some non-latin characters (such as Ä, Ö, or Å) cause explosions:

    re = /\A[^@]+@[^@]+\z/
    email_address = "matti.meikäläinen@example.com"
    puts "Valid" if email_address =~ re
    #=> Valid
    Mail::Address.new email_address
    # Mail::Field::ParseError: Mail::AddressList can not parse |matti.meikäläinen@example.com|
    # Reason was: Only able to parse up to matti.meikä

    Obviously if Mail can’t parse the email address the email won’t be sent to the user…

    My latest approach is to combine the Devise regular expression validation with an additional check that the Mail library can actually parse the user supplied address:

    # app/validators/email_validator.rb
    class EmailValidator < ActiveModel::EachValidator
      def validate_each(record, attribute, value)
        email = Mail::Address.new(value)
        unless email.address =~ Devise.email_regexp
          record.errors.add(attribute, :invalid_email)
      rescue Mail::Field::ParseError => e
        record.errors.add(attribute, :invalid_email)

    If you’re wondering why we need to check that the email address both passes the regex and Mail::Address.new(…), it’s because Mail will happily accept a string such as foo as a valid address:

    email = Mail::Address.new "foo"
    # => #<Mail::Address:2309836100 Address: |foo| >
    # => "foo"

    It would also be possible to pass Mail’s error message back to the user to give her a more detailed explanation of why the email address looks invalid, though this may be more difficult if your app uses internationalisation (as is the case with many of our apps).

    If you enjoyed this, you might enjoy learning more about why emails are generally pretty terrible.

  • Milwaukee MA871

    My latest beer making toy was delivered today: a Milwaukee MA871 digital refractometer.

    I briefly tested it on a couple of samples of water and sugar water and the experience was definitely nicer than trying to peer at the scale through my (admitedly cheap) optical refractometer.

    While perhaps not exactly a necessity over hydrometers or optical refractometers, I’m still really excited to get to use this in anger.

  • Capistrano 3: Deploying via a gateway

    At Kisko some of our projects have production environments with IP restrictions, meaning that we can access the servers from our office but not from any random IP address.

    Despite this, it is handy and perhaps even necessary that we can deploy and access the servers when working remotely or if an emergency crops up when we’re away from the office. Using a VPN or SOCKS proxy is one option, but luckily it is also pretty easy to configure Capistrano 3 to deploy via a bastion or gateway host.

    Set-up Capistrano as your normally would, then add this to your deploy.rb:

      require 'net/ssh/proxy/command'
      # Use a default host for the bastion, but allow it to be overridden
      bastion_host = ENV['BASTION_HOST'] || 'bastion.example.com'
      # Use the local username by default
      bastion_user = ENV['BASTION_USER'] || ENV['USER']
      # Configure Capistrano to use the bastion host as a proxy
      ssh_command = "ssh #{bastion_user}@#{bastion_host} -W %h:%p"
      set :ssh_options, proxy: Net::SSH::Proxy::Command.new(ssh_command)

    Note: Remember to replace the bastion hostname with your own…

    Now when your not deploying from your regular IP address, you can simply set the VIA_BASTION environment variable to deploy via the bastion host. For example:

    VIA_BASTION=1 cap production deploy

    And that’s it!

  • Brewery stamp

    I designed and bought a stamp for my home “brewery” (known as Baltic Sea Brewing).

    Why? Mostly because I could and wanted to…

  • Retrospective: Ilves IPA

    It’s been a bit over a year since I started brewing beer and Ilves IPA was the very first beer I ever brewed (brewed on December 14th 2013, bottled January 4th 2014).

    I’m afraid time has not been kind to this beer, possibly at least due to my suboptimal storage conditions (I don’t have a cool place to store beer for long periods).

    The beer has ended up a bit overcarbed and the flavour profile frankly isn’t great. Luckily this was the last bottle of this gyle of Ilves IPA, so no one will have to have another glass of it ever again.

    If you like brewing, you should check out Beer Styles, a free iPhone and iPad app I built for browsing the 2008 BJCP style guidelines.

  • Books of 2014

    Since I did this sort of thing last year, I figured I might as well make this a tradition of sorts.

    Favourites of the year

    Picking out favourites turned out to be a bit difficult this year (it seems that I read a bunch of good books in 2014), but here’s a few that stuck out.

    Going Clear

    I haven’t quite finished this book yet but having read a bit more than half of it I can already tell that this is going to be one of my favourites for the year.

    Written by Lawrence Wright, a Pulitzer Prize winning journalist, the book details the history of the Scientology movement and the life of it’s founder, L. Ron Hubbard.

    HBO is currently adapting the book into a documentary (slated to air in 2015).

    What If?

    As a long time time fan of xkcd and occasional reader of What If?, this book was most welcome…

    The book is both hilarious and informative. I’m pertty sure there wasn’t a single chapter where I didn’t giggle at least a little bit…

    Command and Control

    Warning: this book is extremely scary and will make you wonder who we (we being humanity) have managed to avoid accidentally blowing ourselves up with nukes.

    Surface Detail

    Since all my other picks where non-fiction, I thought I should include at least one book that isn’t depressing and based on true facts…

    Surface Details turned out to be one of my favourite books from the Culture series by Iain M. Banks. In fact, I ended up reading it twice.

    The full(ish) list

    The (almost) full list of books I read this year. Some books that I had previously read don’t show up on my Goodreads list. Plus there might be a few others missing because of my sloppy Goodreads habits…

    Full disclosure: All book links in this article lead to Piranhas, my book price comparison service.

  • Homebrew wishlist (2014)

    Since there seems to be a bunch of homebrew gift lists floating around, I thought I might as well publish my own little list…

    These are books and other items that I want, not necessarily things that, for example, a novice brewer really needs. In fact, these might not be things I need as much as things I’d quite like to have…


    Digital Refractometer

    Milwaukee MA871

    The Milwaukee MA871 is an affordable and highly praised digital refractometer. It can measure gravity from 0°Bx to 85°Bx (about 1.000 to 1.438 OG) and has automatic temperature correction.

    Using Sean Terrill’s Refractometer Calculator, you can even use it to measure/estimate FG.

    Digital pH meter

    Hanna Instruments HI98128

    The Hanna Phep 5 pH meter is the pH meter recommended by The Electric Brewery and should be accurate and long lasting if cared for correctly. It’s also waterproof and floats if dropped in water or wort.

    You might want to grab some extras along with the pH Meter:


    Farmhouse Ales (by Phil Marowski)

    Farmhouse Ales

    Today’s farmhouse styles resulted from years of evolution, refinement, interpretation and re-interpretation of the simple, rustic ales once brewed on farms in Flanders and Wallonia.

    Farmhouse Ales defines these Saison and Biere de Garde brews in modern and historical terms while guiding today’s brewers toward credible and enjoyable reproductions of these Old World classics.

    For a more detailed book review, see Michael Tonsmeire’s review of Farmhouse Ales on his blog.

    Brew Like a Monk (by Stan Hieronymus)

    Brew Like a Monk

    In Brew Like a Monk, Stan Hieronymus details the beers and brewing of the famous Trappist producers along with dozens of others from both Belgium and America. Sip along as you read and, if you feel yourself divinely inspired to brew some of your own, try out the tips and recipes as well!

    Michael Tonsmeire also has a good review of Brew Like a Monk on his site.

    Full disclosure: Equipment links are Amazon affiliate links. The books link to Piranhas, my book price comparison service.

    You should also install Beer Styles, a free iOS app I built for browsing the BJCP style guidelines.