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
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery | |
set nocompatible | |
set autoindent | |
set tabstop=2 | |
set showmatch | |
set vb t_vb= | |
set ruler | |
set nohls | |
set incsearch | |
syntax on |
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
function title { | |
#[ "$DISABLE_AUTO_TITLE" != "true" ] || return | |
if [[ "$TERM" == screen* ]]; then | |
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars | |
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then | |
print -Pn "\e]2;$2:q\a" #set window name | |
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) | |
fi | |
} |
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
#Deploy and rollback on Heroku in staging and production | |
%w[staging production].each do |app| | |
desc "Deploy to #{app}" | |
task "deploy:#{app}" => %W[deploy:set_#{app}_app deploy:push deploy:restart deploy:tag] | |
desc "Deploy #{app} with migrations" | |
task "deploy:#{app}:migrations" => %W[deploy:set_#{app}_app deploy:push deploy:off deploy:migrate deploy:restart deploy:on deploy:tag] | |
desc "Rollback staging" |
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
# This option has the most clarity, but I generally hate local variables in a | |
# method, preferring to use tap. | |
def calculated_foo | |
available_foos = [] | |
available_foos << bar | |
available_foos << baz.qux if baz | |
available_foos.max | |
end | |
# It's a little less clear, unless you know what tap is, and `end.max` is |