"How-Tos" for Rolling Your Own Short URLs?
ashleyw:     1.to_s(36) #=> "1"
    10.to_s(36) #=> "a"
    100.to_s(36) #=> "2s"
    123456.to_s(36) #=> "2n9c"

Ruby. Where the number is the id of the record in the database or something.