config

Make a file called epoch.rb in your project (I put mine in config/initializers). Use it to store constants that represent the times when big dev events happened. For example: CART_RELEASE = Time.local(2013, 04, 22, 13, 45) We released our shopping cart at 1:45pm on 4/22. Fast forward to today: some of our stats are messed up, for deals that were live across the cart release. I need to fix the stats, but I only want to do it for the affected deals.
2013-05-07
1 min read
UPDATE: I made a gem! Just add gem "marco-polo" to your gemfile to see your app name and environment in your console prompt. I hate when I have a bunch of consoles open and I don’t know which one is local, which is staging, and which is production. I could potentially do a lot of damage by using the wrong one. I find myself typing Rails.env over and over, to figure out which environment I’m in.
2013-01-21
3 min read
The Problem This technique came from my work on table_print, an irb tool for showing ruby objects in tables. I wanted to let people configure its output on a process-wide basis; eg, a default date format so sll their dates are shown consistently in the way they prefer. Additionally, I wanted a simple, easy-to-remember interface and a clean global namespace. The Solution Here’s a basic syntax example for table_printing: # prints all the authors, along with their book titles and photo captions > tp Author.
2012-09-10
3 min read