Summary: click to select
Ever tried emailing someone a chunk of code? Some program output?
It starts in the default font, then you change it to a fix-width font, but you still don’t have any syntax highlighting; and the end user has no easy way to extract it from their email and reuse it.
Oh, how about sharing chunks of text/code/program output via Skype/GoogleTalk where the IM makes no effort what-so-ever to keep your pasted text nicely formatted.
Or, IRC, where its definitely poor form to paste in multi-line chunks of anything. Plus it looks ugly and is completely non-reusable.
The solution is to store the chunk somewhere else (website) and forward that (url) to all and sundry.
How to use?
Hands up if you’ve never driven in a car and used its seatbelts.
Ok, then why does every airline around the world show you how to use one?
Right. So, I’m not going to show you how to use pastie. Its a form and a submit button.
The other day, Chris Wanstrath, took another step closer to becoming a Deity for Novel Helper Apps, with the release of sake – the system-wide Rake tool. A tremendous way to access Ruby code (coded as Rake tasks) from anywhere, without polluting your path, or requiring you to bundle the code as a RubyGem to share it easily.
What does this have to do with pasties?
There is a sake task for sending anything to pastie. Cop a look…
# sake 1.0.6 available now gem install sake -y sake -i http://pastie.caboo.se/73801.txt sake -T sake pastie:send # Sends STDIN or FILE=file to Pastie; # USAGE: cat some_code.rb | sake pastie:send # OR: sake pastie:send FILE=some_code.rb
On OSX, you can get the url for your new pastie in the clipboard using
cat some_code.rb | sake pastie:send | pbcopy
Want to send a patch to someone via pastie?
svn diff | sake pastie:send | pbcopy
and the pastie url is now in your clipboard ready to paste in trac/irc/email, etc.
Pastie-ing sake tasks
Theoretically, you could send someone your beloved sake tasks with:
sake -e my_task | sake pastie:send | pbcopy
As of sake 1.0.6, you can use the
-P option instead:
sake -P my_task | pbcopy
Coming from the future
Rumour has it, (because Chris told me) that Chris and PJ are building an app to take pastie-ing to the next level.
I’m guessing the magic formula will be:
- Create a pastie clone
- Add social networking
- Add versioning of pasties
- Write wicked-cool blog post and link the whole store to a dubious personal trait, such as drinking sake and beer at the same time
- Watch their Working With Rails popularity rankings climb (see Chris and PJ)
Bonus – Railscast competition
To motivate people to submit Rails Documentation Patches he’s now running a competition with prizes!