Joined July 2012
·

Declan de Wet

Node.js Developer at io digital
·
Johannesburg, Gauteng, South Africa
·
·
·

Posted to Never lose scope again by binding over 1 year ago

For better cross browser support (bind does not work in all browsers) you can use apply or call, which both have the added advantage of combining the contextual bind with the actual function execution, so instead of .bind(this); myBar() you can just do .apply(this).

Care to elaborate on this for me?

Posted to CSS Masonry IE7+ over 1 year ago
Posted to CSS Masonry IE7+ over 1 year ago

Hey Cory - the CSS3 multi column polyfill probably didn't work because it doesn't really support HTML5 tags. Good news, though - off of the HTML5 Cross-Browser polyfill list maintained by Modernizr comes a more robust polyfill that does support HTML5 elements: https://github.com/BetleyWhitehorne/CSS3MultiColumn

I never thought of doing something like this. I was maintaining an array of online users and storing the socket.id in a socketIDs array property attached to the user. Which, by the way, I do not recommend - the last socket always stays behind and disconnects never happen. Thanks for this, took a while of Googling, but I will surely refer to it again.

You can get out of callback hell by using named functions instead of anonymous ones. Or, you could use a library to help control flow, like Step or Async.

Can't say much on Redis - used it once, but not the proper way - the only machine I have access to is a Windows one.

As for MongoDB, if I wanted to find one user who's name is "Jeffrey", much simpler to write User.findOne({'name': 'Jeffrey'}) than use a query language at all. MongoDB's "query language" is essentially just JavaScript...

Achievements
211 Karma
47,392 Total ProTip Views