Just about five months ago, Leo Grand's life looked pretty bleak. Homeless since losing his job at Metropolitan Life in 2011, he spent his days panhandling on the streets of New York and nights, seeking out a safe place to sleep. Then in late August, a young man made him a strange offer that changed his life.

23-year-old software engineer Patrick McConlogue, who had been seeing the 37-year-old homeless man for three years on his way to work, asked Leo whether he would like $100 USD to spend on anything he wished or learn how to code. Without even blinking, Leo looked at the kind samaritan and picked the latter. True to his word, Patrick returned the following day with three books on coding and a refurbished Chromebook, and the tutoring began.

Teacher and student would meet for an hour every weekday at about 8am at the city park where Leo spent his nights. After McConlogue left to go to work, Leo would spend another 3-4 hours practicing what they had covered and perusing through one of his three JavaScript books. Thanks to the Wi-Fi hotspot that Patrick had provided he could work almost anywhere. And when his Chromebook ran out of power, he simply walked over to a nearby luxury tower whose residents were happy to let him use the outlets to recharge its battery.

Leo turned out to be a fast and voracious learner. Within four weeks he was ready to start coding his first app and with Patrick's help began, a stealth project which was finally unveiled on December 10th, when 'Trees for Cars' was launched. The $0.99 USD mobile app that is available in the Apple Store and Google's Play Store allows commuters to help the environment and save money, by carpooling.

It works as follows - Anyone desiring a ride can enter in the address of his or her destination. The app will suggest riders that drive to that or a nearby location. The person wishing to get a ride can pick one and send an invite. If the other person accepts, they will be connected. As a way to encourage users, the app tracks how much carbon dioxide was saved by the passengers who use it to get rides with others. All the proceeds from the app will be used to make Leo an even better programmer and hopefully, get him off the streets.

While this is an amazing achievement, neither men are resting on their laurels - Leo has already begun working on the second version of the app and also plans to apply for a job as a programmer. His first stop? The biggest and best - Google Inc.

As for Patrick? He is trying to scale the mentorship program and already has 150 programmers willing to teach people to code for an hour a day, for two months. All he needs to do now is figure out how to organize the effort.

Resources: businessinsider.com, news.yahoo.com