From 4d22b4c1638852863962240c86a4f2dc3ad1151c Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 1 Sep 2021 15:24:14 +0200 Subject: [PATCH] zshrc: add diff alias --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index 4d1452b..0778ab2 100644 --- a/.zshrc +++ b/.zshrc @@ -179,6 +179,7 @@ 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" + alias diff="diff -Naru --color" 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; }