Skip to content

Instantly share code, notes, and snippets.

View ericprud's full-sized avatar

Eric Prud'hommeaux ericprud

View GitHub Profile
@jdforsythe
jdforsythe / .gitconfig
Created March 13, 2019 15:37
Git rename stash alias
[alias]
rename-stash = "!_() { if [ -z \"$1\" ] || [ -z \"$2\" ]; then echo \"git rename-stash 0 NewName\" && echo \"\" && git stash list && exit 1; else stash=\"stash@{$1}\"; rev=$(git rev-parse \"${stash}\"); git stash drop \"${stash}\" || exit 1; git stash store -m \"$2\" \"$rev\" || exit 1; git stash list; fi }; _"
@m93a
m93a / getRelativeURL.js
Created August 26, 2016 10:54
JavaScript URL processing library
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
(function(){
/**
* Rewrite this URL as an URL relative to the base.
* TODO: Doesn't support backslashes!
*
* @parameter {string|URL} base The resulting URL will be relative to this one.