Sunday, July 22, 2007

Ultimate Idiotic Productivity Boost: Auto-Generate Pasties From IRB

This Pastie was auto-generated with itself.

It's so meta I can feel my head caving in.

The clipboard code comes from Projectionist. If you put this code in your .irbrc file, you can do the following:

1. Copy some code you like in a TextMate window
2. Type the word "pastie" in a Terminal window running irb
3. Have the URL for that Pastie in your clipboard

If you use Pastie a lot, and you're on OS X, you'll find this absurdly handy. For the truly impatient, add one more line:

alias :p :pastie

Note that this will kill the normal built-in p alias for puts, so don't do it unless you're feeling reckless. You can always do this instead:

alias :pst :pastie

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.