Skip to content

Instantly share code, notes, and snippets.

@thewisenerd
thewisenerd / transfer.fish
Last active December 8, 2015 03:31 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo -e "No arguments specified.\nUsage:\n\techo transfer /tmp/test.md\n\tcat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
txt=$(cat $1 | tail -1000)
key=$(curl -d post_data="$txt" "http://hastebin.com/documents" | sed 's/{\|}\|\"\|:\|\(key\)//g')
raw_url="http://hastebin.com/raw/${key}"
txt_url="http://hastebin.com/${key}.txt"
echo $txt_url
@thewisenerd
thewisenerd / 0_reuse_code.js
Created May 15, 2014 17:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console