瀏覽代碼

Add utility function for hastebin.com

Alois Mahdal 8 年之前
父節點
當前提交
2114bca40b
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9
    0
      dotfiles/bash/main.bashrc

+ 9
- 0
dotfiles/bash/main.bashrc 查看文件

@@ -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