Rails Recipes

I finally got around to purchasing a copy of the Rails Recipes book by Chad Fowler and I must say I’m enjoying it quite a bit. So I thought I’d contribute to the discussion surrounding the book with a recipe: Quick and Easy Textfilters. Enjoy!

YCombinator in NYT

There’s a nice article in today’s New York Times regarding Paul Graham’s VC firm, YCombinator. You can read it here. I wish PG had been doing this with YC ten years ago. I’ve always been interested in startups and have wanted to found my own company for quite a long time. Perhaps I’ll get the chance yet.

January NovaRUG Meeting

Tonight was the second meeting of the Northern VA Ruby Users Group (NovaRUG) — the first was held back in November.

Rich Kilmer spoke about a project he worked on for BBN (who was contracted by the USAF) to coordinate mid-air refeuling missions written in Ruby and Flash (using his alph toolkit).

It was quite interesting to see how Rich went about writing a domain specific language in Ruby — basically he worked to understand the domain really well and began writing his program in this new DSL then he went back and wrote the Ruby code to parse/eval that DSL. The way Rich described it sounded amazing, but also intimidating — I didn’t feel like I could ever do something like that. I wonder if there’s a good resource for learning metaprogramming — perhaps the Pragmatic Programmers will add such a book to their Facets of Ruby series.

After that Rich gave a demo of InfoEther’s new indi software which resides on a USB key and embeds everything necessary to run on Windows or Mac OS X (a Ruby interpreter, Flash 8 Runtime, WebKit, etc). It includes the basic PIM functionality along with games, IM and an on-line store where you can purchase more apps/plugins. It looks quite interesting and I’ll post more about it once they start the public beta.

It looks like future NovaRUG meetings will be on Wednesday evenings (from 7-9pm). And it looks like FGM will continue to host them for the time being.

Getting the Lat/Long for a Zipcode

I’ve uploaded a short Ruby script which uses Google maps to obtain the lat/long given a zipcode. I needed this since the Cartographer RoR plug-in takes coordinates in the form of lat/long and my customers will only provide me with their zipcodes or complete addresses. Obviously in my Rails web-app I’m storing the lat/long in the DB so I don’t repeatedly query Google Maps. The class simply returns a hash and is trivial to use:

{lang=“ruby”} coords = GMap.to_latlng(“90210”) lat = coords[:lat] lng = coords[:lng]

Download zipcode.zip Updated 2007: This has basically been supplanted by the excellent GeoKit for Rails.