Skip to content

Instantly share code, notes, and snippets.

<canvas id="canvas" style="position:absolute; top:0; left:0;"></canvas>
<div id="buffer" style="display:none;">
@sprhawk
sprhawk / gist:9995088
Created April 5, 2014 17:30
rsync between my macs
rsync -O -vvv -C -ruN --size-only -h --progress --exclude="xcuserdata" --exclude="*.xcworkspace" --exclude=".DS_Store" Docs/ xxxxxx.local::docs
import (
"runtime"
)
_, file, num, _ := runtime.Caller(2)
@sprhawk
sprhawk / git_submodule
Created November 23, 2011 17:08
git command: submodule
$ git submodule add (NOTE: Do not use local URLs here if you plan to publish your superproject!)
Pulling down the submodules is a two-step process. First run git submodule
init to add the submodule repository URLs to .git/config:
$ git submodule init
$ git submodule update
If you want to make a change within a submodule and you have a detached head, then you should create or checkout a branch, make your changes, publish the change within the submodule, and then update the superproject to reference the new commit:
@sprhawk
sprhawk / gist:1389453
Created November 23, 2011 18:24
git command: revert
$ git revert HEAD
Finished one revert.
[master]: created 1e689e2:
"Revert "Updated to Rails 2.3.2 and edge hoptoad_notifier""
$ git revert HEAD~3
ssh-keygen -t rsa -C "..."
to ~/.ssh/github_id_rsa
ssh-add ~/.ssh/github_id_rsa
ssh -T git@github.com
@sprhawk
sprhawk / gist:1399047
Created November 28, 2011 04:04
git command: creating new empty branches
git symbolic-ref HEAD refs/heads/newbranch
rm .git/index
git clean -fdx
<do work>
git add your files
git commit -m 'Initial commit'
http://book.git-scm.com/5_creating_new_empty_branches.html
@sprhawk
sprhawk / gist:1398957
Created November 28, 2011 03:24
git command: stash
$ git stash save "work in progress for foo feature"
$ git commit -a -m "blorpl: typofix"
$ git stash apply
$ git stash list
$ git stash apply stash@{1}