rails

Here’s what Heroku says about dyno memory usage: Dynos are available in 1X or 2X sizes and are allocated 512MB or 1024MB respectively. Dynos whose processes exceed their memory quota are identified by an R14 error in the logs. This doesn’t terminate the process, but it does warn of deteriorating application conditions: memory used above quota will swap out to disk, which substantially degrades dyno performance. If the memory size keeps growing until it reaches three times its quota, the dyno manager will restart your dyno with an R15 error.
2013-08-08
2 min read
Imagine: you open a rails console and type User.limit(100). The output shows your database call, then… ACTIVE RECORD GUT PUNCH!!! Your screen is overrun with an inscrutable wall of text. I hated it. I had some coping mechanisms, but they were cumbersome. For example, the map-and-print: puts User.all.map { |u| "#{u.id}, #{u.email}, #{u.bio}" }.join("\n"); 0 This still sucked. Tons of typing, mid-line typos, forgetting to start with ‘puts’, accidentally returning the whole array - and the output was better but still not great.
2013-02-22
3 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