4 ms·
Share Code Snippets With Ease
- abs_farah 13y agoVery nice. Lots of use cases. For example, I use Stackoverflow a lot and I need to paste code rather than faff around with pastebin. I can see myself using this to get a gist URL in one click.
- nmc 13y agoRuby is not standard on Mac OS X. EDIT: actually it is, thanks the_french. I would be happy to rewrite that in vanilla shell this evening.
- lukabratos 13y agoThat would be great!
- nmc 13y agoIn spite of the fact that Ruby is indeed standard on Mac OS X, a simple shell script would have been clearly lighter. However, for proper JSON escaping of the snippet, you need a full set of replacing rules, which kind of kills the purpose. So I give up.
- the_french 13y agoIIRC ruby is in fact standard and was recently updated to be 2.0.0 on the latest version of OS X. /usr/bin/ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
- lnanek2 13y agoThat's a strange comment. OS X does indeed ship with Ruby. Maybe you are thinking about Rails? Or how developers often update it to a different version before using it? Mac OS X Mavericks includes Ruby 2.0.0p247.
- Asterozemljopad 13y agoVery useful concept. Could this be forked? I would love to see it in action on other platforms as well. And I would be glad to do it.
- p4bl0 13y agoI have something similar as a shell script which can take a file as argument or paste its stdin, but it is for a personal pastebin (well it is public but I don't see the necessity of advertising it). I found this one which does something quite similar: http://sprunge.us/ http://sprunge.us/