Instantly share code, notes, and snippets.

View pre-commit
#!/bin/bash
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
RET=0
if [ "$CURRENT_BRANCH" != "gh-pages" ]; then
make test
RET=$?
fi
exit $RET
View fish-gitc
function gitc
if set -q argv[2] # two args
git clone https://github.com/$argv[1]/$argv[2]
else # one arg
git clone https://github.com/$argv[1]
end
end
View min.vimrc
" basic --------------------------------------------------- {{{
" colors
set t_Co=256
syntax on
set nocompatible
set wrap " for long lines
set textwidth=80 " #
set formatoptions=qrn1 " #
View gitc.sh
gitc () {
if [[ $1 == */* ]]; then
git clone https://github.com/$1 $2
else
git clone https://github.com/$1/$2 $3
fi
}
View cookie-clicker-clicker
View reel (up)
function reel
if test -f $argv[1]
cd ..
else
if pwd | grep -q "$argv[1]"
set x (dirname $PWD)
while test -z (echo (basename $x) | grep "$argv[1]")
set x (dirname $x)
end
cd "$x"
View vimrc
" basic --------------------------------------------------- {{{
" colors
set t_Co=256
syntax on
set nocompatible
set wrap " for long lines
set textwidth=80 " #
set formatoptions=qrn1 " #
View fdl (fish-do-last)
# $ echo "kermit"
# kermit
# $ echo "fozzie bear"
# fozzie bear
# $ echo "miss piggy"
# miss piggy
# $ fdl 3
# kermit
# fozzie bear
# miss piggy
View dolast
#dolast - for the lazy
# usage: dolast <n>
# where <n> is a positive integer representing the number of commands to repeat.
#
# example:
# $ echo "foo"
# foo
# $ echo "bar"
# bar
# $ echo "baz"
View get_time_since.py
#!/usr/bin/python2.7
import sys, os, time
def usage():
print 'Usage:'
print ' $ get_time_since [ (-f | --format) "format string"] /path/to/file'
sys.exit(0)
def get_time_since(event, format_string="%s"):