Thursday Tech Tips
I just got a new machine to work on and building off my own previous advice, I set it up as a brand new machine and migrated nothing from my old one. That being said I had to go about rebuilding my entire dev environment and installing all my applications. While doing so I came across a great write up by Neil Gee on how to quickly get a localhost web server environment going in Mac OS X 10.9 Mavericks. The how to was a huge time server and I thought I would repost it here. So, if you work in a LAMP development environment and find yourself upgrading or getting a new Mavericks machine, this guide will come in very handy.
In the interest of sharing examples of from lessons learned, I have created a demo and write up on how to use the handlebars.js library for processing JSON data returned by an API call and then dynamically display that content on a web page. I deal with JSON data more and more in my work projects and happen to prefer it to XML data, partly because of XML data can be rather large and clunky to deal with. Leveraging handlebars.js allows me to quickly traverse JSON arrays and grab the necessary key : value pairs I need for rendering content. I hope others find this useful. The linked example demonstrates how to use the Gilt API to get current sale items by category, and then use handlebars.js to translate the resulting json data into nice neat little card style objects. Any API that returns JSON data could be substituted in.