Last active
February 29, 2016 11:58
-
-
Save nottrobin/846f58cb96e3e09b577e to your computer and use it in GitHub Desktop.
Helper function for https://clbin.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://clbin.com helper function | |
| # === | |
| # | |
| # Usage examples: | |
| # --- | |
| # | |
| # $ echo "hello world" | clbin | |
| # https://clbin.com/SwP5h | |
| # $ curl https://clbin.com/SwP5h | |
| # hello world | |
| # | |
| # $ echo "hello world" > hello.txt | |
| # $ clbin hello.txt | |
| # https://clbin.com/SwP5h | |
| # $ curl https://clbin.com/SwP5h | |
| # hello world | |
| function clbin { | |
| if [ -n "$1" ]; then | |
| input=$1 | |
| else | |
| input="-" | |
| fi | |
| curl -F "clbin=<${input}" https://clbin.com | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment