Browse Source

Add utility function for hastebin.com

Alois Mahdal 8 years ago
parent
commit
2114bca40b
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      dotfiles/bash/main.bashrc

+ 9
- 0
dotfiles/bash/main.bashrc View File

@@ -53,6 +53,15 @@ gitcd() {
53 53
     cd "$(git rev-parse --show-toplevel)"
54 54
 }
55 55
 
56
+haste() {
57
+    #
58
+    # Send stdin to hastebin.com and print resulting URL
59
+    #
60
+    local a=$(cat)
61
+    curl -X POST -s -d "$a" http://hastebin.com/documents \
62
+      | awk -F '"' '{print "http://hastebin.com/"$4}'
63
+}
64
+
56 65
 clsz() {
57 66
     #
58 67
     # Clear screen and move the prompt to bottom