Steve Challis schallis

View gist:3295572
1 2 3 4 5 6
[alias]
co = checkout
st = status
cm = commit
sm = submodule
lg = log --color --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
View gist:2705714
1 2 3 4 5 6 7 8 9 10
export RED="\033[0;31m"
export NO_COLOUR="\033[0m"
 
function check_keys() {
ssh-add -l >/dev/null
if [ $? -gt 0 ]
then
echo -en $RED
echo "You should add your key to the keychain"
echo -en $NO_COLOUR
View gist:1206332
1 2 3 4 5 6 7 8 9 10
import Image
 
SPACING = 10
 
# Open source images
imgs = map(Image.open, ['1.gif', '2.gif', '3.gif', '4.gif'])
 
# Assume standard dimensions and store them
width, height = imgs[0].size
side_length = sqrt(len(imgs))
View apod.sh
1 2 3 4 5 6 7 8 9 10
# Download the latest pic of the day from NASA and delete or archive any
# previous ones in a specified directory. Optionally create a copy of the most
# current picture to allow OSX to pick up pictures as wallpapers
#
# Steve Challis 2011
# http://schallis.com/2011/mar/20/nasa-astronomy-picture-of-the-day-background/
 
DEST=`dirname $0`
NAME='img.jpg'
NAME_COPY='imgcopy.jpg'
View parents.sh
1 2 3 4 5
parents(){ :(){
read p n <<<`ps -o ppid,comm -p $1 | awk 'NR>1{print $1,$2}'`;
echo -e "$1\t$n";
test $1 -ne 0 && : $p; };
: $1; }
View gist:759659
1 2 3 4 5 6 7 8 9 10
# Quick Bash function to lookup telephone extensions. Better if agrep is installed.
# Usage:
# $ tel steve
# 3900 - Steve Challis
 
# Terminal colour codes
export CYAN="\033[0;36m"
export GREEN="\033[0;32m"
 
PHONE_LIST='/usr/share/phone-extensions.txt'
View geoip-bookmarklet.js
1 2 3 4
var selection = window.getSelection();
if (/^\d+\.\d+\.\d+\.\d+$/.test(selection)) {
window.open('http://www.geoiptool.com/en/?IP=' + selection, '_blank');
}
Something went wrong with that request. Please try again.