Skip to content

Instantly share code, notes, and snippets.

View danbee's full-sized avatar

Daniel Barber danbee

View GitHub Profile
@photo
photo / openphoto-php-upload-cli.sh
Created October 9, 2011 19:39
Upload all photos from a directory using command line (openphoto-php - https://github.com/openphoto/openphoto-php)
#!/bin/sh
source secrets.sh
for i in $(ls /path/to/directory/*.JPG) ; do
./openphoto -h yourhost -e /photo/upload.json -F "photo=@$i" -X POST;
done
@UnderpantsGnome
UnderpantsGnome / pre-commit
Last active September 27, 2015 00:47
My pre-commit hook
#!/bin/bash
debug=`git diff --cached | grep -C 2 -E '+\s*And (open|show me the page|save_and_open_page)'`
pry=`git diff --cached | grep -C 2 -E 'binding.pry'`
debugger=`git diff --cached | grep -C 2 debugger`
console_log=`git diff --cached | grep -C 2 console.log`
conflicts=`git diff --cached | grep -C 2 -E '<<<|>>>'`
if [ -n "$debug" ]; then
echo "debugging statements added in this commit"