Snap a picture of yourself on every commit.
Probably Mac OS X only, I haven't looked into others.
$ brew install imagesnap
$ git config --global init.templatedir '~/.git_template'
$ chmod +x post-commitIn researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.
A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval.
You can find instance_eval used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.
class Article < ActiveRecord::BaseThe no-peeping-toms gem doesn't work properly with Rails 3.2.3.
| # store all solarized files in one place | |
| mkdir ~/.solarized | |
| cd ~/.solarized | |
| # http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html | |
| git clone https://github.com/seebi/dircolors-solarized.git | |
| eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark` | |
| ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors | |
| git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git |
| du -x -k | sort -nr | head -<n> |
| # put this into /etc/logrotate.d/app-production | |
| # to have a Rails app running on unicorns rotating/rolling its logs monthly | |
| # check with logrotate -f /etc/logrotate.d/app-production | |
| /web/app/production/shared/log/*.log { | |
| monthly | |
| missingok | |
| rotate 24 | |
| compress | |
| delaycompress |
| # List of environments and their heroku git remotes | |
| ENVIRONMENTS = { | |
| :staging => 'myapp-staging', | |
| :production => 'myapp-production' | |
| } | |
| namespace :deploy do | |
| ENVIRONMENTS.keys.each do |env| | |
| desc "Deploy to #{env}" | |
| task env do |