Created
January 26, 2013 00:03
-
-
Save jbrechtel/4639025 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget -O ~/deleting_code.mp3 https://dl.dropbox.com/u/2233/deleting_code.mp3 | |
| echo '#!/usr/bin/env ruby | |
| deletions = `git diff HEAD --numstat`.lines.to_a.map do |l| | |
| l.split(" ") | |
| end.map do | |
| |(add,del,_)| del.to_i - add.to_i | |
| end.inject(:+).to_i | |
| Process.fork do | |
| `afplay #{ENV["HOME"]}/deleting_code.mp3` if deletions > 0 | |
| end' > .git/hooks/pre-commit | |
| chmod u+x .git/hooks/pre-commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment