What happens if you’re a prolific developer and decide to release all of the source code from your work? Well, you should get a huge pat on the back from all interested parties. And so we say thank you to [Hunter Davis] for releasing the source code for his 70+ Android apps. But just making the decision isn’t the end of things, you’ve got actually get the code out there. And herein lies the hack. Instead of archiving and posting all of those projects he wrote a script to crawl, init, and push his projects to Github automatically.
This process is made pretty easy because of the Github API. Looks like he used version 2 for his script but you’ll want to check out version 3 if you’re looking to write your own script. His script takes the API key and username as command line arguments, then traverses his local source tree. Along the way it uses some text manipulation to sanitize the directories for use as the name of the repository. Once that’s established it steps into the directory, creates a repository, adds and commits all the files, then pushes them to Github.
Following [Hunter’s] example makes it really easy to share your code. We hope more will follow suit, putting their work out there for others to learn from and build upon.
We’ve seen some hardware hacks from [Hunter] as well. He did a bunch involving the ZipIt, as well as some work with playing games with a Dockstar.
[via Reddit]
You’re welcome, and thanks for checking it out, glad you liked it!
Surely all his android projects were already in git repositories and he just needed the last 2 steps…
Hey Slain,
Many projects were in git repositories, but unfortunately just as many were not. Mostly prior laziness on my part for not having them in a proper source control system.
nice now someone need to make a trojan out of it and inject it to companies, people would be eager to check out the source code. ;)
Just joking… just joking