Skip to content

Instantly share code, notes, and snippets.

View twinsinsnippet's full-sized avatar

twinsinsnippet

View GitHub Profile
@twinsinsnippet
twinsinsnippet / jquery.ba-tinypubsub.js
Created April 28, 2012 04:53 — forked from cowboy/HEY-YOU.md
Javascript: Tiny PubSub
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@twinsinsnippet
twinsinsnippet / gist:2515870
Created April 28, 2012 04:26 — forked from padolsey/gist:527683
Javascript: Detect 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) {}