aboutsummaryrefslogtreecommitdiff
path: root/files/.zsh/rc/S50_functions
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2021-03-16 20:45:14 +0500
committerAnton Bobov <abobov@gmail.com>2021-03-16 20:45:14 +0500
commit013ee40d4ee7b6d014649c263ab6828261cb4e62 (patch)
tree8731cfab7df8a3033f314728570ccb49557b7548 /files/.zsh/rc/S50_functions
parent6670429b44a4dd13387372bdde74a31ec3350c27 (diff)
Updates.
Diffstat (limited to 'files/.zsh/rc/S50_functions')
-rw-r--r--files/.zsh/rc/S50_functions17
1 files changed, 17 insertions, 0 deletions
diff --git a/files/.zsh/rc/S50_functions b/files/.zsh/rc/S50_functions
index dd2441f..cc7b912 100644
--- a/files/.zsh/rc/S50_functions
+++ b/files/.zsh/rc/S50_functions
@@ -55,6 +55,23 @@ st() {
}
compdef st=ssh
+calc() {
+ echo "scale=3;$@" | bc -l
+}
+alias calc="noglob calc"
+
+# Take from @garybernhardt
+activate_virtualenv() {
+ for name in venv env ; do
+ for up in . ../.. ../../.. ; do
+ if [ -f $up/$name/bin/activate ] ; then
+ . $up/$name/bin/activate
+ return
+ fi
+ done
+ done
+}
+
transfer() {
curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename "$1") | tee /dev/null;
echo