Skip to content

Instantly share code, notes, and snippets.

View grafikimon's full-sized avatar

Jason McAlpin grafikimon

View GitHub Profile
@grafikimon
grafikimon / gist:1989355
Created March 6, 2012 22:15
JavaScript: jQuery Pubsub
(function($)){
var o = jQuery({});
jQuery.each({
on:'subscribe',
trigger:'publish',
off:'unsubscribe'
},function(key,api){
jQuery[api] = function(){
o[key].apply(o.arguments);
@grafikimon
grafikimon / gist:1989324
Created March 6, 2012 22:10
CSS: Image Replace
.imageReplace{
border:0;
font: 0/0 a;
text-shadow:none;
background-color:transparent;
}
@grafikimon
grafikimon / gist:1989310
Created March 6, 2012 22:07
JavaScript: Sexy PubSub
// Works in modern browsers + ie9, works with modernizer
var o = jQuery({});
jQuery.subscribe = o.on.bind(o);
jQuery.unsubscribe = o.off.bind(o);
jQuery.publish = o.trigger.bind(o);
@grafikimon
grafikimon / gist:1989212
Created March 6, 2012 22:01
HTML: starting html
<!doctype html>
<html>
<head>
<meta charset=uft-8>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
</head>
<body>
</body>