From 0bd04767acdb8787ba57ba1e066ec88eee770035 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Fri, 6 Jan 2012 20:24:36 +0200 Subject: [PATCH] bashrc & zshrc: Add gitio function. Like the name says, it shortens URLs with git.io. --- bashrc | 6 ++++++ zshrc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/bashrc b/bashrc index 911587cf..4e074930 100755 --- a/bashrc +++ b/bashrc @@ -407,6 +407,12 @@ case "$1" in fi } +# Given by nyuszika7h. Shortens GitHub URLs with git.io +gitio () { + curl -s -i http://git.io -F "url=$1" | grep + --color=never -P '^Location: ' | awk '{ print $2 }' + } + ##### Tmux (example) 4G2W9C ##### # This should be put in .custom or .bash_custom diff --git a/zshrc b/zshrc index acb982a5..9c4a6b1a 100755 --- a/zshrc +++ b/zshrc @@ -350,6 +350,12 @@ case "$1" in fi } +# Given by nyuszika7h. Shortens GitHub URLs with git.io +gitio () { + curl -s -i http://git.io -F "url=$1" | grep + --color=never -P '^Location: ' | awk '{ print $2 }' + } + ##### Tmux (example) 4G2W9C ##### # This should be put in .custom or .zsh_custom