The best part about working with smart people is that you're always learning new things from them.
Here are a few things i learned form the awesome people on the Pulse web team this week.
1. (via @kedo): "onload" events do not bubble in the DOM.
Solution:
http://stackoverflow.com/questions/9829580/using-backbonejs-view-what-is-the-...
2. (via @justinpeterman): "<button>" tags with containing a "<span>" are much easier to style than an "<input type="button">". Especially when you need to style the font.
Snippet:
<button><span>Click Me!</span></button>
http://www.w3schools.com/tags/tag_button.asp
3. (via @kedo) Caching 'length' in for loops is faster than calling it each time through:
Not Cached:
for(var i = 0; i < array.length; i++){ }
Cached:
for(var i = 0, len = array.length; i < len; i++){ }
http://www.erichynds.com/javascript/javascript-loop-performance-caching-the-l...
I look forward to the things i'll learn the next week. :)
I was an avid Oink user and was saddened to see it go away. Alas, services come and go and it's all good as long as you can export your data, right? Wrong!
Oink provided a bunch of CSVs and photos in a zip. CSVs tend to be messy to work with. I needed a JSON with all the information about the places and items. Instead the information provided by the Milk team was minimal (rating, reviews, foursquare_id). They didn't even include the name of the place visited!
I had to make sense of all this data in order to eventually export the data to another service (like Evernote). So, I wrote a Python script which outputs a nicely formatted JSON of all the Oink items including locations.
Script Features
Requirements
Part 1: Get Foursqaure OAUTH Token
Part 2: Execution Instructions
Explore more here:
http://www.businessweek.com/articles/2012-03-08/the-pulse-app-goes-local
Not a lot of code(also messy), so have a look.
Merry Christmas!
Filip