Skip to content

Instantly share code, notes, and snippets.

@erichs
Created March 18, 2013 15:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erichs/5187787 to your computer and use it in GitHub Desktop.
Save erichs/5187787 to your computer and use it in GitHub Desktop.
create GitHub vanity url using git.io shortening service. Works with OSX clipboard
ghanity ()
{
local code="$1" url="$2";
echo 'creating vanity GitHub URL... ';
ghurl=$(curl -s -i http://git.io -F "url=$url" -F "code=$code" | grep Location | awk '{print $2}');
echo $ghurl | pbcopy;
echo "copied to clipboard: ${ghurl}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment