diff --git a/bashrc b/bashrc index 53c7ed46..6ad9fc61 100644 --- a/bashrc +++ b/bashrc @@ -73,7 +73,7 @@ fi unset color_prompt force_color_prompt # Red colour for root, thanks nyuszika7h :D -# check if we're root +# Check if we're root if [[ $EUID == 0 ]]; then PS1='\033[1;31m\u@\h:\w\$\033[0m ' else @@ -408,10 +408,27 @@ 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 }' - } +function gitio() { + curl -s -i http://git.io -F "url=$1" | grep --color=never -P '^Location: ' | awk '{ print $2 }' +} + +function mkcd() { + if [[ $# -gt 1 ]]; then + echo 'Warning: All directories will be created, but will change to first specified directory.' 1>&2 + fi + mkdir -p "$*" + cd "$1" +} + +function gribble-gpg-everify() { + # Set which command to use for gpg. You + # probably want to use gpg2 here. + local gpg=gpg2 + + read -r -i 'Enter Bitcoin OTC URL: ' REPLY + echo -n ';;everify ' + lynx -hiddenlinks=ignore -dump $REPLY | $gpg --decrypt +} ##### Tmux (example) 4G2W9C ##### diff --git a/zshrc b/zshrc index c6e69b2a..11b630dc 100644 --- a/zshrc +++ b/zshrc @@ -353,10 +353,27 @@ 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 }' - } +function gitio() { + curl -s -i http://git.io -F "url=$1" | grep --color=never -P '^Location: ' | awk '{ print $2 }' +} + +function mkcd() { + if [[ $# -gt 1 ]]; then + echo 'Warning: All directories will be created, but will change to first specified directory.' 1>&2 + fi + mkdir -p "$*" + cd "$1" +} + +function gribble-gpg-everify() { + # Set which command to use for gpg. You + # probably want to use gpg2 here. + local gpg=gpg2 + + read -r -i 'Enter Bitcoin OTC URL: ' REPLY + echo -n ';;everify ' + lynx -hiddenlinks=ignore -dump $REPLY | $gpg --decrypt +} ##### Tmux (example) 4G2W9C #####