• go from model to associated table name and back ·

    Given a table object, it returns the related string object; e.g. SubAttribute => 'sub-attribute'. Useful if you want to make a list of all your tables with perhaps their fields listed out to the side.

  • conditioner for ActiveRecord-friendly conditions from a collection ·

    I frequently have a collection of values that I want to match in an ActiveRecord query, but it would be nice if I could let ActiveRecord handle checking the data and escaping it properly. So, I wrote this method to return ActiveRecord-friendly conditions, such as:

    ["user_id=? AND job_id=?", 3, 4]
  • simple Rails preference storage ·

    So you’ve got some Rails application and you need to store information from the users across their interactions with the app. Here’s a simple, straightforward way to do that.

  • custom shapes in Photoshop ·

    Custom shapes can be very useful for making multiple objects that look the same. For example, say you want several photos to all be cut out of the same shape, like this: flamingo