Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Emson emson

View GitHub Profile
@emson
emson / dotfile.sh
Created Mar 2, 2012
dotfile.sh allows you to sync all your '.files' using Dropbox
View dotfile.sh
#!/bin/sh
REPO=$HOME/Dropbox/Dotfiles
PLATFORM=$(uname)
die() {
echo "fatal: $1"
exit 1
}
@emson
emson / cdf.sh
Created Dec 2, 2011
Script to cd to the last opened finder directory
View cdf.sh
# function to change directory to the one set in the last opened finder.
cdf () {
currFolderPath=$( /usr/bin/osascript <<" EOT"
tell application "Finder"
try
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
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
emson / .vimrc
Created Oct 26, 2011
Piotr's .vimrc
View .vimrc
if $SHELL =~ 'bin/fish'
set shell=/bin/sh
endif
" Needed on some linux distros.
" see http://www.adamlowe.me/2009/12/vim-destroys-all-other-rails-editors.html
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
@emson
emson / mysql_utils.sh
Created Sep 27, 2011
Quick and dirty MySQL utils
View mysql_utils.sh
#!/bin/bash
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
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
PATH="$PATH:/usr/local/mysql/bin"
PATH="$PATH:/usr/local/mysql/support-files/"
PATH="$PATH:~/scripts:"
export PATH=$PATH
export EDITOR='mate'
@emson
emson / .vimrc
Created Aug 22, 2011
My .vimrc file
View .vimrc
" .vimrc based on Ryan Tomayco's vim file
" https://github.com/rtomayko/dotfiles/blob/rtomayko/.vimrc
" ---------------------------------------------------------------------------
" General
" ---------------------------------------------------------------------------
set nocompatible " essential
You can’t perform that action at this time.