Joined August 2012
·
Posted to
Parsing json responses the lazy (as in I-hate-if's) way
over 1 year
ago
@tralamazza Just realised. Nice way of sanitising the data.
Posted to
Parsing json responses the lazy (as in I-hate-if's) way
over 1 year
ago
Wouldn't the following do the trick too?
var arrayoffoos = obj.foos || [];
EDIT:
Ah, stupid, the concat takes care of the single value issue of course.
Posted to
coderwall logo made with HTML & CSS
over 1 year
ago
I'd include ITC Avant Garde Gothic for the people that do have the font on their computers.
Achievements
275 Karma
16,730 Total ProTip Views

Nephila Komaci
Have at least one original repos where PHP is the dominant language

Forked 50
Have a project with a thriving community of users that's been forked at least 50 times

Bear
Have at least one original repo where Objective-C is the dominant language

Lemmings 100
Write something great enough to have at least 100 watchers of the project

Forked 20
Have an established project that's been forked at least 20 times

Forked
Have a project valued enough to be forked by someone else

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Charity
Fork and commit to someone's open source project in need

Cub
Have at least one original jQuery or Prototype open source repo

Kona
Have at least one original repo where CoffeeScript is the dominant language

Mongoose
Have at least one original repo where Ruby is the dominant language
There's also the option to make the perspective container scrolling, and drop the JS. Tadaa: instant parallax. Because the content moves in a scrolling div, you don't need to adjust the perspective origin. Neat trick, right?
Unfortunately, you'll lose elastic scrolling on mobile, and that is quite a deal breaker.
For now, onscroll + touchmove appears to be the best solution.
EDIT:
See http://keithclark.co.uk/articles/pure-css-parallax-websites/ for the pure CSS solution.