diff options
author | Mathias Bynens <mathias@qiwi.be> | 2013-06-03 18:42:41 +0200 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2013-06-03 18:48:18 +0200 |
commit | 4f48f250197668f2d961a71ef733b37675f810fa (patch) | |
tree | b26cb32a105c792d25a3eafce8c8661c265342b1 /.functions | |
parent | 007d32adce26ea0a4265d82193d628998974f4b0 (diff) | |
download | dotfiles-4f48f250197668f2d961a71ef733b37675f810fa.tar.gz dotfiles-4f48f250197668f2d961a71ef733b37675f810fa.tar.bz2 dotfiles-4f48f250197668f2d961a71ef733b37675f810fa.zip |
.functions: Add `gitio`
Closes #210.
Diffstat (limited to '.functions')
-rw-r--r-- | .functions | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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}" |