From 858a4a31a251d0eab21dffb96776aca007dafb07 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Fri, 14 Feb 2020 19:11:04 -0500 Subject: Squashed 'dot_local/share/toasty/' content from commit aee4da7 git-subtree-dir: dot_local/share/toasty git-subtree-split: aee4da752bdb07b0524bb8803ead46d4093fa57f --- functions/autosource | 10 ++++++++++ functions/brpaste | 6 ++++++ functions/sourceall | 16 ++++++++++++++++ functions/sprunge | 2 ++ 4 files changed, 34 insertions(+) create mode 100644 functions/autosource create mode 100644 functions/brpaste create mode 100644 functions/sourceall create mode 100644 functions/sprunge (limited to 'functions') diff --git a/functions/autosource b/functions/autosource new file mode 100644 index 0000000..12b6bab --- /dev/null +++ b/functions/autosource @@ -0,0 +1,10 @@ +#!/bin/zsh +local f= +local p= +for f +do + for p in $spath + do + [[ -r $p/$f ]] && . "$p/$f" && break + done +done diff --git a/functions/brpaste b/functions/brpaste new file mode 100644 index 0000000..b4cf5ef --- /dev/null +++ b/functions/brpaste @@ -0,0 +1,6 @@ +#!/bin/zsh +host='https://brpaste.xyz' +[[ $# -eq 0 ]] && set -- '-' +brpaste_id=$(curl -\#fF "data=<$1" "$host") \ + || { echo 'ERROR: Upload failed!' >&2 && return 1; } +printf '%s/%s\n' "$host" "$brpaste_id" diff --git a/functions/sourceall b/functions/sourceall new file mode 100644 index 0000000..b63c58b --- /dev/null +++ b/functions/sourceall @@ -0,0 +1,16 @@ +#!/bin/zsh +local ext= +local f= +local p= + +# calling `sourceall zsh` will source *.zsh, otherwise * +(( $# > 0 )) && ext=".$1" + +for p in $apath +do + [[ -d $p ]] || continue + for f in $p/*$ext(.N) + do + [[ -r $f ]] && . $f + done +done diff --git a/functions/sprunge b/functions/sprunge new file mode 100644 index 0000000..c76ed76 --- /dev/null +++ b/functions/sprunge @@ -0,0 +1,2 @@ +#!/bin/zsh +curl -F 'sprunge=<-' http://sprunge.us -- cgit v1.2.3