Sharing
Share Code Snippets Easily From the Command Line
This is a great tip I found at commandlinefu to easily share code snippets write from the command line.
First, you may want to add this to your aliases file:
1 | alias share='curl -F "sprunge=<-" http://sprunge.us | xclip' |
(If you don’t have the xclip program, you can easily install it from your package manager.)
Now, say that you have a c program named “hello.c”, to share it, type this (after reloading your aliases file of course):
cat hello.c | share
Now, the code is already in the internet, and the URL is in your clipboard. Go to firefox and click the middle mouse button in the URI area. You’ll see a URL similar to this:
http://sprunge.us/BaFS
To view the code with syntax highlighting and line numbers, just append “?c? (or “?lang” where ‘lang’ is the relevant programming language). So the final URL should look like this:
http://sprunge.us/BaFS?c
Enjoy
Google’s Tip Jar
A (new?) service by google, which is a part of Google Moderator, is the “Tip Jar”.
“Tip Jar” is a collection of tips, submitted by the users, and categorized into different categories: Home, Work, Tech, Finance etc…
Users can submit new tips, and vote for tips submitted by others. The tips are displayed according to their popularity (which might be bad for new tips, since it will be harder to discover them).
Anyway, it looks like a nice service by Google, and another step towards making information available for everybody (who can afford a PC and internet connection).
Check it here.
Use Codepad to Save, Share and Compile Code Snippets
In a previous post, I wrote about Bonetree’s Codebox, a very nice web interface to share syntax highlighted snippets.
Codepad is a similar tool, with more features: You can compile your code and save it permanently. It also has a plugin for vim, which allows you to save/run your code in codepad right from vim.
Codepad supports a few languages, like C, C++, PHP, Python and others. There are many languages it does not support though.
About Me
Tags
My Twitter
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Science
- Security
- Shell Scripts
- Short Posts
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Archives
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)

Me @ Social Media