aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.functions9
1 files changed, 9 insertions, 0 deletions
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}"