Filed under: Ruby

Code Formatter for Blogger

This was something that my friend was asking me the other day, after he got a pang of envy looking at my code formatting in my wordpress blog (this blog). Ofcourse, there is no inbuilt method for formatting code in blogger. There are roundabout manners by which you can do it, but its too much trouble to ask for. So, instead of explaining all the weird methods in the world, i decided to Google for an online solution and hit upon this: http://alexgorbatchev.com/SyntaxHighlighter/

Read the rest of this post »

My Ruby Notes

[This post will be my Ruby Notes which i will keep updating. It is more like a personal Ruby manual.] Numbers: [sourcecode language="ruby"] population = 12_000_000_000 # means the same thing as population = 12000000000 [/sourcecode] Variables: begins with a small letter => normal variable begins with a capital letter => Constant begins with a $ => Global Variable begins with a : (colon) e.g. :a => Symbol begins with an @ => Instance Variable begins with an @@ => Class Variable in between two |'s e.g. |x| => Block arguments

Read the rest of this post »

Hello Ruby

This is probably my 1st line  of Ruby Code that i am blogging here. Learning Rubys these days. So here it is - [sourcecode language="ruby"] 10.times{ print "Hello Ruby."} [/sourcecode]   I must thank Partiosh Chhibber, my friend for his help with this post.