diff options
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}" |