aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2013-06-03 18:42:41 +0200
committerMathias Bynens <mathias@qiwi.be>2013-06-03 18:48:18 +0200
commit4f48f250197668f2d961a71ef733b37675f810fa (patch)
treeb26cb32a105c792d25a3eafce8c8661c265342b1 /.functions
parent007d32adce26ea0a4265d82193d628998974f4b0 (diff)
downloaddotfiles-4f48f250197668f2d961a71ef733b37675f810fa.tar.gz
dotfiles-4f48f250197668f2d961a71ef733b37675f810fa.tar.bz2
dotfiles-4f48f250197668f2d961a71ef733b37675f810fa.zip
.functions: Add `gitio`
Closes #210.
Diffstat (limited to '.functions')
-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}"