diff --git a/zshrc b/zshrc index b7cb2f0..d755b10 100644 --- a/zshrc +++ b/zshrc @@ -179,11 +179,13 @@ alias dc='docker-compose' alias urlencode='python2 -c "import urllib, sys; print urllib.quote_plus( sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()[0:-1], \"\")"' alias urldecode='python2 -c "import urllib, sys; print urllib.unquote_plus(sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()[0:-1])"' + alias obs="QT_QPA_PLATFORM=xcb obs" transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi;tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; } ix () { curl -n -F 'f:1=<-' http://ix.io 2>/dev/null ;} + viman() { text=$(man "$@") && echo "$text" | vim -R +":set ft=man nomod nonu noma nolist colorcolumn=" - ; } upload() { # inspired by https://www.alexander-pluhar.de/paste-file-host.html # make eternity the default lifespan