Skip to content

Instantly share code, notes, and snippets.

View .bash_profile
echo 'Applying ~/.git-completion.bash code-completion stuff...'
# bash/zsh completion support for core Git.
# Copyright (C) 2006,2007 Shawn O. Pearce <>
# Conceptually based on gitcompletion (
# Distributed under the GNU General Public License, version 2.0.
View .vimrc with Vundle
" Install Vundle first:
" git clone ~/.vim/bundle/Vundle.vim
" Launch vim and run :PluginInstall
set t_Co=256
View .tmux.conf
# remap prefix to Control + q
set -g prefix C-q
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
campbell / gist:6041801
Created Jul 19, 2013
Database management for Heroku production apps. Backup locally and restore to either the local or production database.
View gist:6041801
namespace :msc do
namespace :db do
APP = 'fake-app-namer'
desc 'Backup the Postgres db'
task :backup => :environment do
`heroku pgbackups:capture --app #{APP}`
`curl -o #{backup_filename} \`heroku pgbackups:url --app #{APP}\``
campbell /
Created Mar 31, 2015
Automated GIT BISECT Bash function

Use this script to automatically find where a SPEC fail was introduced. You can add it to .bash_profile.

Syntax: run_git_bisect <bad SHA> <good SHA> <failing test file:number>

function run_git_bisect() {
  [ "$#" -eq 3 ] || die "You must provide the bad SHA, good SHA and the failing test filename[:number]"
  git bisect reset
View const_lookup.rb
class Outer
puts Module.nesting
A = 'outer'
puts Outer::A #=> outer
class Outer
class Inner
puts Module.nesting
puts A #=> outer