Skip to content

Instantly share code, notes, and snippets.

View jphenow's full-sized avatar
💻
👋🏻 :octocat:

Jon Phenow jphenow

💻
👋🏻 :octocat:
View GitHub Profile
# 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
@jphenow
jphenow / deploy.rake
Last active December 18, 2015 00:09 — forked from njvitto/deploy.rake
#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"
@jphenow
jphenow / .zshrc
Created December 19, 2012 16:42 — forked from ehlertij/.bash_profile
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
}
@jphenow
jphenow / .vimrc
Created May 4, 2011 20:20 — forked from jeresig/.vimrc
VIM Config
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