Skip to content

Instantly share code, notes, and snippets.

def open3_with_timeout(cmd)
#require 'pry'; binding.pry
inp, out, err, wait_thr = Open3.popen3(cmd)
inp.close
did_timeout = false
still_open = [out, err] # Array that only contains the opened streams
output_buffer = ''
stderr_buffer = ''
# Rails Stuff
alias stoprails='kill -9 $(lsof -i :3000 -t)'
alias startrails='rails server -d'
alias restartrails='stopRails && startRails'
#Check PHP For Erroes
alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l'
# ROT13-encode text. Works for decoding, too! ;)
alias rot13='tr a-zA-Z n-za-mN-ZA-M'