Programming is tedious. If you’re a developer, you will undoubtedly recognize doing the following on a daily basis:
1) Performing a search using your favorite search site for a specific code fragment that will solve your specific task.
2) Looking through several blogs and question and answer sites to finally find the solution to your issue.
3) Copy-pasting that code into your own work.
4) Modifying it to suit your needs.
That’s a lot of work! But worst of all is that you have to park you’re thinking, open a browser and start looking for your solution. By the time you find a solution to your problem and get back into your work you probably lost track of what exactly you were doing in the first place!
So, there’s a new web app: http://codecook.io, that tries to solve this problem. The website has user created code snippets in a wide range of languages. Solutions to many common programming issues can be found there. However, the observant reader will notice that up to this point this is no different than any of the other code libraries out there. What sets this new site apart is that you can customize a snippet and use the API to directly integrate it into your own work. This means you are able to immediately insert code solutions into your work and easily have it tweaked for your situation.
At the heart of the application is a templating system. A code fragment on the site is basically just a template with variables in it. End users can customize these snippets by providing values for the variables which are then parsed both server side and client side using AngularJS. This feature is extended to code editors by using plugins that interact with the REST API. This way, you can search using an editor plugin and immediately insert customized code fragments into your own work.