This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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\]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| PS1="\w\$(parse_git_branch) $ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -name .svn -print0 | xargs -0 rm -rf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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)]/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, |
OlderNewer