Skip to content

Instantly share code, notes, and snippets.

View grahamgilchrist's full-sized avatar

Graham Gilchrist grahamgilchrist

View GitHub Profile
@grahamgilchrist
grahamgilchrist / package.json
Last active August 29, 2015 14:06
Grunt submodule
{
"name": "grunt-my-custom-webfont",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "0.4.1",
"grunt-webfont": "0.4.8",
}
}
@grahamgilchrist
grahamgilchrist / gist:11284766
Created April 25, 2014 10:25
Pull latest master and merge it to branch
#!/bin/bash
# usage: git-push-master branchname
# script to pull the latest master of current repo and merge it into the specified branch and push that branch back to the remote
set -x #echo on
BRANCHNAME=$1
git checkout master
git pull
git checkout $BRANCHNAME
#Add git branch to terminal
#Git prompt
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
GREEN="\[\033[0;32m\]"
WHITE="\[\033[0;37m\]"
YELLOW="\[\033[0;33m\]"
@grahamgilchrist
grahamgilchrist / gist:5730457
Created June 7, 2013 16:17
Cross browser shims for animationEvents
// Cross browser shims
// Return appropriate browser transitionend event(s)
// defined as an IIFE because it only ever needs to run once
// See http://stackoverflow.com/questions/5023514/how-do-i-normalize-css3-transition-functions-across-browsers
utils.transitionEvent = (function(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionEnd transitionend',
@grahamgilchrist
grahamgilchrist / app_download.plist
Last active October 12, 2015 00:48
iOS wireless app distribution
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
@grahamgilchrist
grahamgilchrist / gist:3928105
Created October 21, 2012 19:03
Create XBMC .nfo files from mkvs in directory
root=$(pwd)
movieset=$1
echo $root
for file in $root/*.mkv
do
filepath="${file%.*}.nfo"
filename=$(basename $file)
echo "Processing $filename"
echo "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n" > $filepath
echo "<movie>" >> $filepath
@grahamgilchrist
grahamgilchrist / gist:2718754
Created May 17, 2012 13:00
Git branch highlighting in prompt (add this to your .bash_profile in your user directory)
GREEN="\[\033[0;32m\]"
WHITE="\[\033[0;37m\]"
YELLOW="\[\033[0;33m\]"
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)/"