Leo Grand, by his own admission, didn't know the first thing about computer programming four months ago. The 37-year-old man was living on the streets of New York City in late August, when a complete stranger approached, offering a choice between two months of coding lessons and $100 in cash.

Grand opted for the lessons, and 3,621 lines of code later, he has released his first mobile app. The app — an environmentally conscious carpool organizer called "Trees for Cars" — went live on the App Store just after 12:00 a.m. ET Tuesday, around the same time it went live for Android users.

We caught up with Grand and his teacher, 23-year-old programmer Patrick McConlogue, on the night Trees for Cars launched, and waited with the duo until after midnight in an otherwise empty New York City office.

"This is going to change my life in a magnificent way," Grand told Mashable shortly after the launch.

For his part, McConlogue didn't seem to mind that his initial offer of lessons for one hour a day for two months had stretched to three-and-a-half month journey with a marathon finish.

"It is by far the most rewarding experience of my life," McConlogue said.

The two began their lessons on Aug. 26. McConlogue provided Grand with a used Chromebook laptop and a few text books. The first two months consisted of outdoor lessons conducted on the city benches near Chelsea Piers, where Grand slept.

After the hour-long lessons, McConlogue would head off to work, while Grand continued to review and practice what he learned until his computer's battery died. Aided by one of his many friends in the area, Grand recharged the battery overnight at a nearby warehouse.

At the end of the two months, however, Grand and McConlogue realized it was going to take much more work to achieve their goal of launching a mobile app.

With the weather turning colder at the end of October, Grand and McConlogue received an unexpected bit of good fortune. Buoyed by an offer from McConlogue's boss, Princeton Review founder John Katzman, the duo moved their lessons into the New York City office of Katzman's new educational search engine company Noodle. Katzman allowed McConlogue to work with Grand on the app full time for the past five weeks.

"My boss deserves a...," McConlogue said, trailing off before finishing the thought: "I owe him big."

Though the project has earned them tens of thousands of supporters, Grand and McConlogue watched the app go live in the office where they had spent so much time working together. Instead of clinking champagne glasses and lighting celebratory cigars, they exchanged high fives and relieved looks, surrounded by the energy drinks and empty pizza boxes that fueled them to the finish.

Grand said he has already began to research for the next iteration of his app, "Trees for Cars II." He also said he hopes to soon land a job as a computer programmer, though he has yet to submit any applications.

"My first application will be at Google," Grand said. "It's right up the block."

Meanwhile, McConlogue is working to scale his mentorship program. He said more than 150 programmers around the world have signed up to spend an hour each day for two months teaching others how to code, though he hasn't yet figured out how to organize the effort.

"I have to figure out how to structure this," McConlogue said.

The duo did not have much time to enjoy their accomplishment. By 12:30 a.m., they left the office for a 1 a.m. TV interview. Their story has already been featured on NBC, CNN and a number of online news outlets.

Grand carried three bags full of his possessions out of the Noodle office to the interview. At the end of the night, he said he would still be sleeping on the street. But with his new app and his new skills, Grand said he was optimistic his fortunes would change before long.

Images: Mashable

BONUS: Inside a Homeless Man's Quest to Reprogram His Life