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 comma to separate the digits, for example in US standard we use comma every 3 digits. So number written above can be re-written as:
Now 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 more easy to read;)
I hope you will find this technique somewhere useful ;)
I got 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 goes to my friend Taroon Tyagi.
Heroku as a server
Octopress as bloggin platform
Couple of gems to make things working.
I hope people will find it useful. In case you face any problem to the this code up and running. Feel free to contact me.