Skip to content

Instantly share code, notes, and snippets.

View shillcock's full-sized avatar

Scott Shillcock shillcock

View GitHub Profile
#!/bin/sh
# Find and replace shell script
find . \( -name '*.cpp' -o -name '*.h' \) | xargs sed -i -e s/$1/$2/g
find . -name \*-e | xargs rm
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\w\$(parse_git_branch) $ "
find . -name .svn -print0 | xargs -0 rm -rf
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
imapsync --host1 imap.gmail.com \
--port1 993 --user1 user\@gmail.com \
--passfile1 ./passfile1 --ssl1 \
--host2 imap.gmail.com \
--port2 993 --user2 user@domain.com \
--passfile2 ./passfile2 --ssl2 \
--syncinternaldates --split1 100 --split2 100 \
--authmech1 LOGIN --authmech2 LOGIN \
--regexmess 's/Delivered-To: user\@gmail.com/Delivered-To: user\@domain.com/g' \
--regexmess 's/<user\@gmail.com>/<user\@domain.com>/g' \
@shillcock
shillcock / .bashrc
Created January 16, 2009 22:05 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
#!/bin/sh
# shell script to backup a mysql database
RM=/bin/rm
MV=/bin/mv
TAR=/bin/tar
GZIP=/bin/gzip
CHOWN=/bin/chown
DUMP=/usr/bin/mysqldump
# http://robsanheim.com/2009/01/14/upgrading-git-via-macports/
sudo port sync
sudo port deactivate git-core
sudo port install git-core +svn+bash_completion+doc
git --version
@shillcock
shillcock / gist:58273
Created February 4, 2009 19:03 — forked from pete/gist:57898
Experiments in revision control: Curry recipe.
My personal recipe for Japanese curry, which has mutated over the years and is
now open-source thanks to github, hot damn. Some of the ingredients are not
very Japanese, but curry came to Japan from England which got it from India to
begin with, so whatever.
1.5 - 2 lbs. of meat, prefer thin-sliced beef (komagire), pork works, too.
Thin-sliced stuff is always best, but in a pinch stewing beef works. Bacon
works surprisingly well. Chicken will work, technically, but if you must,