Amazon.com Widgets
...not so private reflections of greg.newman
Categories & Search

Recently in Ruby Category

The Pug Automatic: Flickr Style Tagging in Rails

Someone asked on IRC for Ruby code to split tags Flickr style, e.g. getting the tags from tag1 tag2 'tag 3 has spaces' tag4.

I came up with this:

def parse_tags(string)
  string.split(/"(.+?)"|\s+/).reject {|s| s.empty? }
end
It even preserves tag order, which you wouldn't get if you'd first gsub out (and store) quoted tags and then split the rest."

I haven't tried it yet but looking at it looks like a fine implementation. Very simple.

[Via Pug Automatic.]

Starling is a light-weight persistent queue server that speaks the MemCache protocol. It was built to drive Twitter's backend, and is in production across Twitter's cluster.

(Via I am rice.)

I installed it on Safari 3.0.4 (Leopard) and it works great. You can find out more about Microformats at Microformats.org, and while you're at it, check out Mofo, a rails plugin to work microformats into your project.

If you like to keep track of your calls for billing purposes or just because you're anal retentive then iPhonelogd is for you. It's a little ruby script that when run from the command line will log your calls into iCal. Give it some extra parameters and it will put them into a particular calendar.