Posts

Method of the Month 1: Ruby's sort vs. sort_by

Ruby’s Array has 2 methods for sorting: sort and sort_by. Both methods sort your array (obviously) but they do it in slightly …

Walk Like a Duck

Introduction In a duck-typed language like Ruby, it’s very important that you actually use duck typing. This is especially …

Automatically log in on merb-auth account creation

Recently I was adding new user registration to tasteb.in and I wanted my users to be automatically logged in as soon as they created …

Fix Missing Disqus Comment Form

I had a bit of trouble with Disqus where it would only display a link saying “Discuss this topic on Disqus” instead of …

tasteb.in is up!

I’ve been working on a Merb-based recipe paste site for the past couple weeks called tasteb.in. It’s extremely simple for …

Play in the Sandbox

I needed to test some code that reads and writes files on the filesystem. I got sick of manually setting up a scratch area for my test …

How to learn Ruby

UPDATE 4/20/2010: Well Grounded Rubyist is not prerelease anymore. Corrected. UPDATE 6/30/2011: Fix links to _why’s poignant …

Sinatra block parameters!

The latest master Sinatra now supports optional block parameters. It captures any parameters in the URL and passes them into the block …

Run specs with autotest, er, autospec!

It seems that it’s not well publicized, but if you want to run your RSpec files with autotest try autospec instead. It looks …

Gearing up for CodeMash