about summary refs log tree commit diff
path: root/functions/misc_functions.sh
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-08-15T15·14-0400
committerWilliam Carroll <wpcarro@gmail.com>2016-08-15T15·14-0400
commit4563550969467223f422df1eda9c15165d24607c (patch)
treecbdf9570a5ffa0176e79eff3df63690cfa443624 /functions/misc_functions.sh
parent6021ad31941203dafc2abd643a98fb549b620c6a (diff)
Trims fat and renames files
Diffstat (limited to 'functions/misc_functions.sh')
-rw-r--r--functions/misc_functions.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/functions/misc_functions.sh b/functions/misc_functions.sh
new file mode 100644
index 000000000000..17c13d7a6ae9
--- /dev/null
+++ b/functions/misc_functions.sh
@@ -0,0 +1,40 @@
+# download files to /tmp directory
+function wdownload {
+  URL="$1"
+  FILENAME="$(basename $URL)"
+
+  wget -O /tmp/"$FILENAME" $URL >/dev/null && open /tmp && echo "Downloaded to: /tmp/$FILENAME" || echo "Error ..."
+}
+
+
+# spell checker
+function wspcheck {
+  if [ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"
+  cat "$input" | tr '[:upper:]' '[:lower:]' | tr -cd '[:alpha:]_ \n' | tr -s ' ' '\n' | sort | comm -23 - ~/english_words.txt
+}
+
+
+# fuzzily search through dirs stack
+function wfd {
+  dir=$(dirname $(fzf)) && pushd "$dir" >/dev/null
+}
+
+
+# pushd into a directory on your dirs stack
+function wpushd {
+  dir="$(dirs | tr ' ' '\n' | fzf)" && pushd "$dir"
+}
+
+
+# trims leading and trailing whitespace
+function trim {
+  input="$1"
+
+  echo "${input//[[:blank:]]/}"
+}
+
+
+function wgreviewers {
+  echo "BJ Warshaw\nDaniel Wasilewski\nSean Sullivan\nCharles Morrissey\nRyan Balch\nZach Goldstein\nWilliam Anderson"
+}
+