$ curl -o pspc16 https://dl.dropboxusercontent.com/u/856934/pspcl6
$ chmod +x pspc16
$ gem install snoop terminal-notifier
$ ruby why.rb
This file contains 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
# Find all SHAS with a single line diff | |
SHAS=`git log --stat --oneline |\ | |
grep "| 2 +-" -B1 |\ | |
egrep -v "^(\s|-)" |\ | |
cut -d' ' -f1` | |
# Of those SHAS, find the ones with single character diff | |
git show --word-diff=plain -p --oneline `echo $SHAS` |\ | |
egrep "(\[-|{\+).(\+}|-\])" -B10 |\ | |
grep "$SHAS" |
This file contains 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
:args `git grep -l .` | |
:argdo :%s/\s\+$//gc | w |
This file contains 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
[alias] | |
bam = "!source ~/.githelpers && delete_local_merged_branches" | |
bamr = "!source ~/.githelpers && delete_remote_merged_branches" |
This file contains 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
# Be notified when a new house matching your criteria is posted to Craigslist | |
require 'snoop' | |
MAX_RENT = 1900 | |
BEDROOMS = 2 | |
CITY = 'portland' | |
CATS = true | |
DOGS = true |
This file contains 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
arabic: | |
hello: "مرحبا العالم!" |
This file contains 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
source 'https://rubygems.org' | |
gem 'foreman' | |
gem 'sinatra' |
This file contains 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
" Run specs with ',t' via Gary Bernhardt | |
function! RunTests(filename) | |
" Write the file and run tests for the given filename | |
:w | |
:silent !clear | |
if match(a:filename, '\.feature$') != -1 | |
exec ":!script/features " . a:filename | |
else | |
if filereadable("script/test") | |
exec ":!script/test " . a:filename |
This file contains 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
def foo(x, y); end | |
def bar(x, y = 2); end | |
def baz(x = 1, y = 2); end | |
method(:foo).arity #=> 2 | |
method(:bar).arity #=> -2 | |
method(:baz).arity #=> -1 | |
def buz(x, y: 2); end | |
def pat(x: 1, y: 2); end |
This file contains 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
def test_proc | |
Proc.new { return }.call | |
puts 'Never see this...' | |
end | |
def test_lambda | |
lambda { return }.call | |
puts 'Do see this...' |