Month: October 2010

  • Wow, this video is awesome!

    A must see indeed. Specially if you don’t believe in it.

  • Faking it: enums in Ruby

    Ruby doesn’t have enums and in Rails I sometimes need it. I’ve come out with my own way of doing after some trial and error. First I want to be able to access these enums as constants in a class, like: That’s actually quite easy: If I’m storing those values on the database, I’d like…

  • Metaprogramming Ruby

    Metaprogramming Ruby

    There are thousands of books that will take you from illiterate to novice in any programming language. But finding those that will take you from novice or intermediate to expert is hard. I remember reading Effective Java some years ago and wishing I had something like that for Python. I’ve never found one. Metaprogramming Ruby…

  • 360 vision

    I’m surprised I’ve never seen this idea being tried… When I’ve was a kid I’ve read a report about an experiment. A guy put goggles with screens so that he could see nothing but the screens (ala virtual reality). The same device also had one or two cameras and the screens projected an upside-down image…

  • The magic of Bundler

    Recently I reported a bug for Formtastic. Justin French, the author of Formtastic, created a branch and made a fix. He then asked me for my feedback. I look at the code and then decided to give it a try. In a pre-Bundler world that would have required this: Find a directory to play with…

  • Redirecting back

    It’s very common in Rails CRUD to have a create and update actions that redirect back to the show action. The idea is that you show an object, click edit, save, go back to showing said objects with your changes. All is fine until you have an edit link somewhere else. Let’s say you have…

  • Generating sample data

    As I’ve said in previous posts, I like being able to generate sample data for the projects I’m working on very quickly. It allows new developers to get up to speed fast, and new developers to move faster. When I don’t have a sample data generation method, I’m always scare to try whether, for example,…