Skip to content

Instantly share code, notes, and snippets.

@drunkel
Last active August 29, 2015 14:21
Show Gist options
  • Save drunkel/883515699fb9042ab886 to your computer and use it in GitHub Desktop.
Save drunkel/883515699fb9042ab886 to your computer and use it in GitHub Desktop.
Things I always forget:
#Execute a script in rails console
load './path/to/foo.rb'
#Stub constants in a file. Gotta put in quotes, because rails.
before :each do
stub_const('MyClass::FOO_CONSANT', some_value)
end
#Clean branches on remote that are merged to master
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d #Run from master, or like, delete all your stuff
git fetch --prune #sync your remote
#Set your OSX machine to UTC time
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
# Generate a file of specific size from OSX command line
# eg. mkfile -n 2g filename # makes a 2gig file
mkfile -n size[b|k|m|g] filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment