bdunagan
fill the void

Posts Tagged development

Rack Tip: ActiveRecord with Logging

Using ActiveRecord in Rack is one line of Ruby code, and setting up database logging outside of Rails is just as easy. As a minor extension of this excellent tidbit, you simply instantiate the Logger object with a file path. Here’s the code:


Rails Tip: Locking Cron Jobs

I really like using the Ruby whenever gem for managing cron jobs in Rails. But recently I needed to ensure there was only one instance of a cron job running. If it took a bit too long, I didn’t want another instance starting up in parallel. Enter flock.


Sanitizing POST params in Rack

Rack is a handy way to get Ruby up and running on a web server, but it’s picky about input. Recently, I tried to post a URL with an ampersand (&) to a Rack instance, and because the URL contained an ampersand, Rack parsed the data wrong. It considers ampersands to be separating tokens. When [...]


Compiling PowerPC with LLVM GCC 4.2 in Xcode 4.1 on 10.7 Lion

There have been a number of excellent articles describing how to restore various older technologies to Xcode 4 (10.4 SDK, 10.5 SDK, GCC 4.0, PPC). Thanks to mecki for doing such a good job detailing the steps. The only trouble is those steps didn’t work for me in one case: PowerPC support. Luckily, it’s easy [...]


blog.data.visualize()

This blog’s sidebar got a little fancier today: sparklines! Inspired by infosthetics’s google adsense sparklines post, I’ve added a couple interesting streams of data to the sidebar, both from this website and from my iOS App Store apps. Sparklines are an excellent visualization for conveying a large amount of information in a small space. Here’s [...]