I am here to share a small tip that I just come to know about Ruby. A simple question. How many zeros are there integer written below?
Difficult to count right? In normal day to day practice, we generally use a comma to separate the digits, for example in US standard we use a comma every 3 digits. So number written above can be re-written as:
Now the same thing can be done with long integers in Ruby using an underscore, something like this:
which is actually same as writing 100000000000, but using underscore makes things easier to read;)
I hope you will find this technique somewhere useful ;)
I got a couple of requests to release the source code running this blog as few people liked the theme :) Glad to hear that. I am sorry for being so late to release the code.If you want to download the code feel free to fork the repo from github. Design credits go to my friend Taroon Tyagi.
Heroku as a server
Octopress as blogging platform
Couple of gems to make things working.
I hope people will find it useful. In case you face any problem to this code up and running. Feel free to contact me.