Ruby, method_missing and 'no id given'

Note: if you just happen to be interested in knowing possible causes for the ‘no id given’ error message in Ruby, go to the last paragraph of this post.

I don’t have reason to do a lot of Ruby metaprogramming myself, although being a Rails user, I surely receive a lot of benefit from it. Metaprgramming is used extensively in Rails, the most visible example I can think of is the ActiveRecord Dynamic Finders.

Working on my current pet project, I had occasion to do a little metaprogramming in a similar vein to the ActiveRecord Dynamic Finders. I have a model with two sets of paperclip attachments. One is for when an attachment is first uploaded to my server and the other is for when the attachment is subsequently moved to Amazon S3 for permanent storage. The file stored on my server is deleted after successful transfer to Amazon S3. Read more...

How I've started to contribute to open source

A couple of weeks ago, I read a post by Brandon Hays called ‘“Why I still don’t contribute to open source":’ wherein Brandon lays out his reasons for not yet having contributed to any OSS projects. To reiterate Brandon’s points:

  1. There’s no certification, ceremony, or merit badge that says, ’you’re ready to contribute to OSS’.
  2. It’s not obvious where to start.
  3. Guidelines often make a maintainer’s life easier, and mine harder.
  4. Open source is for people who are better at this than me.
  5. Trying to contribute and failing makes me feel stupid.
  6. There’s no time.
  7. It’s pretty lonely.

I found Brandon’s article interesting because I can definitely relate to a lot of what he says.

How do I know I’m ready to hack on an open source project? And if I’m not ready but jump in anyway, won’t I potentially just be broadcasting my stupidity across the Interwebs for all to see? How do I know where to start? The code base seems so intimidating and I know nothing about it. Are any hazing rituals involved? Those guys are so much better at hacking code than I’d be after ten lifetimes, how the fuck did they get so smart? Or am I just really retarded? I’ve got my own stuff I want to work on. All these sentiments I’ve felt at one time or another.

But recently, I’ve started contributing to open source projects anyway. Read more...

Is it time to chrome my web browsing?

I remember when I first heard of Google’s new browser, dubbed Chrome. I was sitting at my desk at work, reading the news and for a moment I thought I could almost hear the wailing and gnashing of teeth emanating from clear across the other side of the world at Redmond.

There were some obvious wins for Chrome right out of the gate. Independent processes for tabs meant that if a page crashed it wouldn’t take down the whole browser with it. Security was also enhanced with this model of tab isolation, if I remember correctly. There was the V8 JavaScript engine, tests by Google in September 2008 showed that JavaScript execution in Chrome was about three times faster than Firefox 3.0 and about ten times faster than Internet Explorer 7. There was some debate over the real world applicability of these results, but little doubt that Chrome was kicking ass at JavaScript. A modern browser made to support the quickly burgeoning age of JavaScript heavy web applications. Read more...

New gem: self-notifo

I’ve never created a Ruby gem before, although I use other people’s gems a lot. So I decided recently that I might have a go at making one myself. I needed to find something nice and small to start off with. Read more...

Configuring Nginx and Phusion Passenger on Debian Lenny

Continuing on from my previous post on compiling Nginx with Phusion Passenger, some configuration is now in order.

To give credit where due, I’d like to mention that I found much help on the Slicehost articles and tutorials site and adapted some of their instructions for parts of this post. Thanks Slicehost! Read more...

Compiling Nginx with Phusion Passenger on Debian Lenny

After compiling Ruby 1.9.2 on my Debian Lenny web server, the next thing I wanted to do was get an actual web server going for serving up Rails apps. I’ve been an Apache user for a long time but I’d been hearing about Nginx and how it’s kicking ass and taking names, so I thought I might give it a go. I also needed some way to hook Rails up with Nginx. Read more...