Skip to content

Instantly share code, notes, and snippets.

View talentedmrjones's full-sized avatar

Richard A. Jones talentedmrjones

View GitHub Profile
@talentedmrjones
talentedmrjones / .zshrc
Last active January 17, 2025 16:50
Easily keep your git repo clean by automating pruning and deleting stale branches. Simply add this line to .zshrc (or other shell config)
# checkout main
# pull origin
# prune origin
# delete local branches that were pruned from origin
alias gpmp="git checkout main && git pull && git remote prune origin | grep \"\[pruned\]\" | xargs -I % echo % | sed -e 's/\* \[pruned\] origin\///g' | xargs -I % git branch -D %"
@talentedmrjones
talentedmrjones / arguments.callee.js
Last active August 29, 2015 13:57
arguments.callee is not the "name"
(function (n) { // function has no name, is therefore "anonymous"
var i=n*2;
if (i > 4) {
return undefinedFunc(); // causes a "ReferenceError: undefinedFunc is not defined at Object.<anonymous>"
} else {
arguments.callee(i); // recurses, adding the anonymous function to the call stack
}
})(1);