One of the greatest feel-good stories of the year comes from New York City, where earlier this fall a software engineer met a homeless man and taught him how to write code. The story also goes to show how a random act of kindness can pay the most amazing dividends.

Leo Grand Homeless Man

Story of the homeless man

Patrick McConlogue came to recognize several homeless people he saw on a regular basis in the Chelsea Piers neighborhood where he worked at an education search engine business named Noodle. One homeless man stuck out to Patrick as a little different than the rest, and one day Patrick decided he wanted to try and help out.

Also see: Apple Inc. (AAPL) Offers Free Coding Classes

He stopped and spoke to the man, whose name was Leo Grand. Patrick offered Leo either $100 with no strings attached or the chance to learn how to write code. Leo, who had been homeless for more than five years, was educated and used to work for Met Life, but he didn’t even really know what coding was. But he decided to take a chance to learn something even if he really could have used the $100.

“I am an unusual person,” Grand said, “Learning something new for me being a scientist was I would say, another mental notch under my belt that I didn’t mind having.”

Tools for coding

McConlogue gave Grand three books on JavaScript, a Samsung Chromebook with 3G, access to Codeacademy and a solar charger. Patrick also began showing up to work an hour early every day to teach Leo the basics of programming. It turned out Leo was a natural programmer. He took to coding like a fish to water, and after a few months of morning tutoring sessions he was ready to start writing real code on his own.

When Patrick was asked, “Can you learn to code in two months?”, he replied, “You can fall in love with coding in two months,” and that is what happened to Leo. The coding lessons continued informally for almost four months.

Homeless man’s successful app

In fact, Leo’s coding skills became so good he has written his own App. The app is called “Trees for Cars”, and is a carpooling app that matches up people interested in either offering or a receiving a ride throughout the city. The app also graphically displays how much CO2 users are saving and even offers a community gamification platform to encourage people to conserve more.