Skip to content

Instantly share code, notes, and snippets.

View bestie's full-sized avatar
❤️‍🔥

Stephen Best bestie

❤️‍🔥
View GitHub Profile
@bestie
bestie / gist:2648506
Created May 9, 2012 20:16
How big are my Ruby files and which is the biggest?
find . -type f -name "*.rb" | xargs wc -l | sort -nr
@bestie
bestie / pre-commit
Created September 16, 2011 20:28
Rails Git pre-commit hook for ensuring schema.rb and migration changes commit atomically
#!/usr/bin/env ruby
# vim: set syntax=ruby
# Ensures that changes to the Rails schema.rb file may only be committed if a
# migration file is also committed at the same time.
def schema_modified?
%x[ git diff --cached |grep schema.rb ] == ''
end