Skip to content

Instantly share code, notes, and snippets.


Ben Emson emson

View GitHub Profile
emson /
Created Mar 2, 2012 allows you to sync all your '.files' using Dropbox
die() {
echo "fatal: $1"
exit 1
emson /
Created Dec 2, 2011
Script to cd to the last opened finder directory
# function to change directory to the one set in the last opened finder.
cdf () {
currFolderPath=$( /usr/bin/osascript <<" EOT"
tell application "Finder"
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
emson / .vimrc
Created Oct 26, 2011
Piotr's .vimrc
View .vimrc
if $SHELL =~ 'bin/fish'
set shell=/bin/sh
" Needed on some linux distros.
" see
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
emson / .gvimrc
Created Oct 26, 2011
Piotr's .gvimrc
View .gvimrc
if has("gui_macvim")
" Command-T for CommandT
macmenu &File.New\ Tab key=<D-T>
map <D-t> :CommandT<CR>
imap <D-t> <Esc>:CommandT<CR>
" Command-Return for fullscreen
macmenu Window.Toggle\ Full\ Screen\ Mode key=<D-CR>
" Command-Shift-F for Ack
emson /
Created Sep 27, 2011
Quick and dirty MySQL utils
function is_file_exists() {
local f="$1"
[[ -f "$f" ]] && return 0 || return 1
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
emson / .bash_profile
Created Sep 9, 2011
My .bash_profile
View .bash_profile
# Ben's .bash_profile file
# path settings
PATH="/usr/local/bin:/usr/local/sbin:$PATH" # if not already present
export PATH=$PATH
export EDITOR='mate'
emson / .vimrc
Created Aug 22, 2011
My .vimrc file
View .vimrc
" .vimrc based on Ryan Tomayco's vim file
" ---------------------------------------------------------------------------
" General
" ---------------------------------------------------------------------------
set nocompatible " essential
You can’t perform that action at this time.