Skip to content

Instantly share code, notes, and snippets.

View kevinmccaughey's full-sized avatar

Kevin McCaughey kevinmccaughey

View GitHub Profile
@kevinmccaughey
kevinmccaughey / spec_watchr.rb
Created June 17, 2012 18:21 — forked from seven1m/spec_watchr.rb
watchr config for Rails + RSpec projects, uses Growl (Mac) or notify-send (Linux)
# put this in spec/watchr
# use with Spork
# run with `watchr spec/watchr`
# images are from Tango icon theme
# http://commons.wikimedia.org/wiki/Tango_icons#Weather
# for added bonus:
# set keyboard shortcuts Ctrl-Alt-S to run "pkill -USR2 -f spork"
# ...and Ctrl-Alt-T to run "pkill -USR2 -f watchr"
@kevinmccaughey
kevinmccaughey / gist:2409551
Created April 17, 2012 22:39 — forked from hopsoft/gist:1122080
Rails Environment Based Behavior
# app/models/user.rb
class User < ActiveRecord::Base
end
# lib/user_logger.rb
module UserLogger
def self.included(mod)
mod.send :after_create, :log_creation
end