• Benchmarking Ruby Enterprise Edition

    January 31, 2011 at 11:42 AM
    As part of a perpetual quest to make things run faster, I benchmarked various Ruby configurations using the Urbanspoon codebase. We have a smoke test that hits our key pages regularly to ensure things are running well, and I decided to use this for speed comparison as well. My methodology was simple. Run a local staging se...
  • Experimenting with Mirah for Android

    January 21, 2011 at 9:42 AM
    A while ago I wrote about Closures in Duby . Duby is now called Mirah, and it's a promising way to write compiled code without the weight of Java syntax. I've been updating Urbanspoon's Android application, and I decided to use Mirah for portions our next release. Getting started Mirah is available as a JRuby gem. Hopefull...
  • Migrating salted md5sums to Bcrypt

    December 16, 2010 at 9:32 PM
    In light of recent events , I thought it prudent to change our password storage to use bcrypt hashes. Salting md5sums isn't the worst thing you could do, but it's really not as great as it might seem at first blush. Salted md5s are the leather jacket of bullet-stopping apparel: demonstrably stronger than your plaintext cot...
  • A simple redirect resolver

    December 15, 2010 at 8:53 PM
    Did you know that curl has an option to automatically follow HTTP redirects? Combined with the HEAD method, this can be used to quickly trace the end destination in a chain of redirecting URLs: #!/bin/sh (echo $1 && curl -LIs "$1" | grep '^Location' | cut -d' ' -f2) | cat -n The meat of the work is in the curl opti...
  • Stirling's approximation in Clojure

    November 24, 2010 at 11:12 PM
    In my free time, I've been working through Probability Theory: A Concise Course by Y.A. Rozanov. The first chapter contains a great factorial approximation that anyone doing computer-based statistics or combinatorics ought to know: This is Stirling's Approximation . As n grows, the relative error of this function compared...
  • Facebook Connect, IE, and the Mysterious IFrame

    November 16, 2010 at 10:36 PM
    The Facebook Connect JavaScript does some really neat things to function the way it does, but one of its behaviors is unexpected and downright buggy. When attempting to establish a cross-domain communication channel in Internet Explorer (IE8, at least – perhaps not the others), it loads a duplicate copy of the curren...
  • Rails 2 Upgrade Turbulence: a Series

    October 21, 2010 at 7:39 AM
    Here are several posts on Rails 2 upgrade issues that I encountered at Urbanspoon: General Cleanup Disabling Sessions ActiveRecord Woes git-svn Workflow Warts Troubleshooting a Slow Production Deployment I've found it common for startups to get stuck on old versions of Rails because the incremental upgrade task is always l...