Skip to content

Instantly share code, notes, and snippets.

@FrenchBen
Created November 11, 2021 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrenchBen/b25d925a8c0401ff17fc93c72c0c91ee to your computer and use it in GitHub Desktop.
Save FrenchBen/b25d925a8c0401ff17fc93c72c0c91ee to your computer and use it in GitHub Desktop.
Quick paste-bin like alternative

Using HasteBin

Manual

$ curl -s -X POST https://www.toptal.com/developers/hastebin/documents -d "Hello World!"
{"key":"aeiou"}
$ curl https://www.toptal.com/developers/hastebin/raw/aeiou
Hello World!

Bash Lightweight Alternative

haste() { a=$(cat); curl -X POST -s -d "$a" https://www.toptal.com/developers/hastebin//documents | awk -F '"' '{print "https://www.toptal.com/developers/hastebin/"$4}'; }

Usage:

cat file.txt | haste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment