Skip to content

Instantly share code, notes, and snippets.

View bjorg's full-sized avatar

Steve Bjorg bjorg

  • San Diego, CA
View GitHub Profile
@bjorg
bjorg / JDoc
Last active August 29, 2015 14:08
Concept for a JDoc implementation that is fluent and well-typed.
// ----------
// Definition
// ----------
class JDoc {
//--- Types ---
class ArrayBuilder<TOuter> {
//--- Methods ---
@bjorg
bjorg / git-delete-remote-merged.sh
Created April 9, 2013 22:03
Script to delete all *remote* branches that have been merged into the local master branch. Useful after updating the local master branch and removing the remote branches that have been merged into master.
#!/bin/sh
git remote prune origin
git branch -r --merged origin/master | awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | xargs git push origin --delete
git remote prune origin
@bjorg
bjorg / git-delete-merged.sh
Created April 9, 2013 22:02
Script to delete all local branches that have been merged into the local master branch. Useful to run after update local master and removing old branches that have already been merged. **IMPORTANT:** make sure to switch to 'master' before you run this command.
#!/bin/sh
git branch --merged master | grep -v "\*" | xargs -n 1 git branch -d
@bjorg
bjorg / git-remote.sh
Created April 9, 2013 21:59
Script for showing all Git branches and what remote branch they are mapped to (if any).
#!/bin/sh
git for-each-ref --format='%(refname:short)' refs/heads/* | while read b
do if r=$(git config --get branch.$b.remote)
then
m=$(git config --get branch.$b.merge)
echo "$b -> $r/${m##*/}"
else
echo "$b -> MISSING REMOTE"
fi
done