Skip to content

Instantly share code, notes, and snippets.

View timsweb's full-sized avatar

Tim Williams timsweb

  • Wordery
  • Berkshire, UK
View GitHub Profile
@timsweb
timsweb / as30v.sh
Created September 24, 2014 09:49
Reformat AS30V on a mac and import GPS assist data
#!/bin/bash
diskutil reformat AS30V
if [ ! -d "/Volumes/AS30V" ]; then
echo "Volume not remounted"
exit
fi
mkdir -p /Volumes/AS30V/private/SONY/GPS
wget http://control.d-imaging.sony.co.jp/GPS/assistme.dat -O /Volumes/AS30V/private/SONY/GPS/assistme.dat
@timsweb
timsweb / pre-commit
Created July 9, 2013 11:12
Git hook to prevent committing xdebug_break() functions. Save as .git/hooks/pre-commit then chmod +x it. Submodules also have their own hooks folder: ".git/modules/submodule/path/here/hooks".
#!/bin/sh
if git-rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
for FILE in `git diff --cached --name-only` ; do
# Check if the file contains 'debugger'
@timsweb
timsweb / redisProtocol.py
Created January 14, 2013 13:22
Quick and dirty tool to convert normal redis commands (like "SADD set value") from stdin to redis protocol for piping into "redis-cli --pipe".
#!/usr/bin/python
import sys
import shlex
def main():
for line in sys.stdin:
args = shlex.split(line)
protoLine = '*%d' % len(args)
protoLine += "\r\n"
for a in args: