From 4f48f250197668f2d961a71ef733b37675f810fa Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Mon, 3 Jun 2013 18:42:41 +0200 Subject: .functions: Add `gitio` Closes #210. --- .functions | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to '.functions') diff --git a/.functions b/.functions index 418852e..a95e7bc 100644 --- a/.functions +++ b/.functions @@ -85,6 +85,15 @@ function dataurl() { echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')" } +# Create a git.io short URL +function gitio() { + if [ -z "${1}" -o -z "${2}" ]; then + echo "Usage: \`gitio slug url\`" + return 1 + fi + curl -i http://git.io/ -F "url=${2}" -F "code=${1}" +} + # Start an HTTP server from a directory, optionally specifying the port function server() { local port="${1:-8000}" -- cgit v1.2.3