Skip to content

Instantly share code, notes, and snippets.

View maxvipon's full-sized avatar

Maxim Ponomarev maxvipon

View GitHub Profile
@maxvipon
maxvipon / ie-detect.js
Last active October 11, 2015 11:27 — forked from padolsey/gist:527683
JavaScript: Detecting IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@maxvipon
maxvipon / jquery-pubsub.js
Last active October 11, 2015 11:27 — forked from TexRx/gist:2010435
JavaScript: PubSub [jquery]
/* @paul_irish Pub/Sub
* Works in modern browsers + IE9
* Use Modernizr ployfill for function.bind */
(function($) {
var o = $({});
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);
}(jQuery));