Monthly Archives: October 2009

Simplicity is Complicated

The favorite rhetorical fallback of politicians of every stripe is “it’s for the children”. Anything can be justified in terms of making things better for children if you frame it right. Lately I’ve begun to think that the word “simple” … Continue reading

Posted in Uncategorized | Tagged , | 34 Comments

Copying Amazon SimpleDB Domains

Just a quickie today. Amazon SimpleDB has no built-in way to copy a domain – for the purposes of backing it up, for instance, or for populating a development domain with data from the production domain. Using the RightAws tools … Continue reading

Posted in Uncategorized | Tagged , , , , | 6 Comments

NullDB for DataMapper

The first Ruby library I ever released, and still the one I get the most emails about, is NullDB. NullDB is an ActiveRecord database adapter which simply turns every database operation into a no-op. It is useful for speeding up … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

ISO8601 Dates in Ruby

ISO8601 is a standard for representing date/time information as a string. ISO8601 dates look like this: 2009-10-26T04:47:09Z. There are a lot of good reasons to store dates in the ISO8601 format. The format is… Unambiguous. There is never any question … Continue reading

Posted in Uncategorized | Tagged , , , , , , | 8 Comments

Double-Load Guards in Ruby

If you’ve ever worked with C or C++ you no doubt remember that one of continual headaches of working with those languages is avoiding double-inclusions of header files. Most C headers start and end with preprocessor directives in order to … Continue reading

Posted in Uncategorized | Tagged , , , , | 7 Comments

Patching flymake for Ruby development

Flymake is a wonderful thing, and the Ruby/Flymake integration introduced by rails-mode is very, very handy. If you’re not familiar with it, Flymake is an Emacs minor mode that constantly checks your syntax in the background and marks up any … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Array-ifying Values

I can’t remember if I’ve written about this before. On the assumption that I haven’t, I’ll forge ahead. As I’ve mentioned in the past I hate null checks. They clutter up code and add nothing meaningful to the code’s narrative. … Continue reading

Posted in Uncategorized | Tagged , , , , | 6 Comments

Viewing REST service responses in a browser

Have you ever had this experience? You’re debugging some RESTful service and trying to figure out why it’s returning 500s. So you dump the response body to STDOUT and HOLY HAND GRENADE THAT’S A LOT OF HTML!!! Wouldn’t it be … Continue reading

Posted in Uncategorized | Tagged , , , , | 2 Comments

Safely executing commands with user data

Do you ever need to call out to a shell command with some user-supplied arguments? category = ‘riddles’ fortune = `fortune #{category}` Q: What’s the difference between a Mac and an Etch-a-Sketch? A: You don’t have to shake the Mac … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

My WebOS Makefile

One of the first things I do when developing with a new framework is automate as much as I can. When it comes to automating builds, GNU Make is still king of the hill. Sure, it has a notoriously finicky … Continue reading

Posted in Uncategorized | Tagged , , , , , , | 4 Comments