added some functions from mathias bynens's dotfiles