• Bacon.js on the Server

    Using Bacon.js to escape from Butcher Bay callback hell has been quite a pleasant, if mind-bending, experience. However, there hasn’t been too much talk about real usage on the server-side. I’d like to remedy this situation with some examples and tips I learned while converting a simple hand-coded REST API to Bacon.js.

  • Gun-shot Wound by User-Friendly (in the Foot)


    • One spoonful of OSX
    • A sprinkling of Git
    • Three pounds source code


    1. Rename user.coffee to User.coffee, setting core.ignorecase just in case
    2. Commit, push
    3. Edit User.coffee and watch as git diffs don’t make any sense, git reset doesn’t reset, git stash doesn’t stash, git commit -a doesn’t commit.
    4. Laugh with glee as your editor jumps between the current and an old-old-old version
    5. Go on holiday, give up, freak out

    Serve for two

    1. Realize (probably with help from colleagues) that the OSX file-system is not case-sensitive
    2. Go to GitHub or clone the project on Linux
    3. Realize that both user.coffee and User.coffee exist
    4. Delete user.coffee
  • Enter: the Coding Dojo

    After having fought my way through Clean Code, I’m now reading The Clean Coder. Both are great books you should read. Clean Code helped me crystallize and expand on the ideas I had about good code. The Clean Coder is more about the part of programming you spend away from your computer; estimation, testing strategies, communicating inside and outside the team, generally being a professional. The whole book is really about being professional. (Disclaimer: links are affiliate links to Amazon)

    I already have two active to-do items. There’s a whole paragraph asking “do you know what X is”? And honestly, I have no idea about most of those X’s. Not even what they may be about. So it’s probably time to pick up some more theory. On the other hand, Uncle Bob emphasizes actively honing your programming skills. A good way to do that is code katas. The term, apparently started here, is taken from martial arts: a kata is a series of excercises you practice until you achieve perfect form (for an appropriately small threshold).

  • Yesod: Ignore Trailing URL Slashes

    Just a note if you need / want to remove the redirects of yesod (a Haskell web framework) from http://myhost.com/ to http://myhost.com. You can find the below instance declaration in Foundation.hs if you’re using the scaffold. If not, you’ll know where it is, because you put it there :)

        instance Yesod App where
            cleanPath _ pieces = Right $ filter (not . ((==) "")) piece

    This ignores any trailing slashes (and duplicates as well), so that all the following URLs will be considered the same as http://myhost/a/b

    • http://myhost/a/b/
    • http://myhost//a//b
    • http://myhost/a/b//
    • http://myhost/a/b
  • Managing Your Private Server with Chef

    You’re a cool kid, right? All the cool kids have their blog and other stuff on a VPS (or on GitHub, but that’s a different story). Really cool kids have their stuff on Linode, by the way; yes, that’s a referral link. All the cool kids use Chef to manage their infrastructure at work consisting of N-hundred Heroku dynos and AWS instances. So why not manage your VPS with Chef? While you’re at it, why not upload the whole thing to GitHub? (Like this)

    [4]: http://wiki.opscode.com/display/chef/Chef Solo