Skip to content

Instantly share code, notes, and snippets.

View dirtystylus's full-sized avatar

Mark Llobrera dirtystylus

View GitHub Profile
@brandonkelly
brandonkelly / Make 'git difftool' use Changes.app
Created October 30, 2010 13:41
Make 'git difftool' use Changes.app
After clicking Changes > Install Terminal Utility…, add this to ~/.gitconfig:
[diff]
tool = changes-app
[difftool "changes-app"]
cmd = /usr/bin/chdiff $LOCAL $REMOTE
[difftool]
@cowboy
cowboy / github_post_recieve.php
Created October 11, 2010 02:04
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
#!/bin/bash
cat .gitignore | egrep -v "^#|^$" | while read line; do
if [ -n "$line" ]; then
OLD_IFS=$IFS; IFS=""
for ignored_file in $( git ls-files "$line" ); do
git rm --cached "$ignored_file"
done
IFS=$OLD_IFS
fi