More functions, borrowed from Paul Irish's dotfiles