Sunday, March 6, 2011

When life hands you lemons...

If you're unemployed, and want to know how many days it's been, how many years experience you have, and with which companies, this Ruby class will tell you. Basically, initialize the WorkHistoryAnalysis class, pass in each experience as "<name>, [start date], [end date]" in YYYY,MM,DD format as shown at the bottom of the file. A little report will be generated at the console.



How to embed code snippets in blogger

Blogger.com (this blogging service) is terrible for embedding code.  Everything gets mangled, double-spaced and mis-formatted. Just terrible. But there is an answer to code snippet embedding: Gist.

Gist is a free service run by Github, the open-source project hosting service. Gist allows you to post code snippets share them via a unique URL, and even allows for comments. Just go to The Gist Website, paste in your code, give it a title and description, then click "embed" and copy the link. You can paste the link into your blog, and (using javascript) it will embed an un-mangled code snippet, just like this: