Yeah... The post you linked is better than this one... And they're 90% similar. But the author of this post did give the credits: "NOTE: this article is a rewritten copy of http://coderwall.com/p/euwpig?i=3&p=1&t=git and have been put here only in purpose of note to myself. However you may use for your own needs..." than all is well!