Skip to content

Instantly share code, notes, and snippets.


Aman Roy aman-roy

Block or report user

Report or block aman-roy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aman-roy /
Last active Dec 30, 2019
upload files via terminal using API
# Upload file via terminal using
# Author : Aman Roy (
upload () { if [ $# = 1 -o $# = 2 ];then if [ -f "$1" ];then if [ $# = 1 ];then curl -F "file=@$1" ;else if [[ "$2" =~ ^[1-9]+[wmy]$ ]];then curl -F "file=@$1"\?expires=$2;else echo $'Wrong expiration format.\neg. 1(w/m/y), etc.';fi;fi;else echo "file doesn't exist";fi;else echo $'usage: upload file_name.ext [expiration]\nexpiration format: 1-9(w/m/y) # (w)eeks, m(onths), (y)ear';fi }

Keybase proof

I hereby claim:

  • I am aman-roy on github.
  • I am amanroy ( on keybase.
  • I have a public key whose fingerprint is 3D47 9FD4 E127 528A C5ED 599A 3E0F 4707 D0DD 596E

To claim this, I am signing this object:

You can’t perform that action at this time.