Skip to content

Instantly share code, notes, and snippets.

Kyle Travis ktravis

Block or report user

Report or block ktravis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ktravis
ktravis / pre-commit
Created Aug 27, 2015
git hook to run tests pre-commit
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
@ktravis
ktravis / fish-gitc
Created Mar 30, 2014
gitc for the fish sell
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 " #
@ktravis
ktravis / gitc.sh
Last active Dec 24, 2015
function for git clone laziness
View gitc.sh
gitc () {
if [[ $1 == */* ]]; then
git clone https://github.com/$1 $2
else
git clone https://github.com/$1/$2 $3
fi
}
@ktravis
ktravis / cookie-clicker-clicker
Last active Dec 23, 2015
A clicker for cookie clicker. Refresh to reset.
View cookie-clicker-clicker
@ktravis
ktravis / reel (up)
Created Aug 6, 2013
reel is an "up" command for fish, inspired by reddit.
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 " #
@ktravis
ktravis / fdl (fish-do-last)
Last active Dec 20, 2015
Fish-do-last is dolast, for fish-shell.
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
@ktravis
ktravis / dolast
Created Aug 6, 2013
A bash function to do the last $1 commands, and combine them in history.
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"):
You can’t perform that action at this time.