Skip to content

Instantly share code, notes, and snippets.

@yakcode
yakcode / gist:4187044
Created December 2, 2012 05:09
JavaScript: JQuery PubSub
//Jquery version of using pubsub
(function($) {
var o = $( {} );
$.each({
on: 'subscribe',
trigger: 'publish',
off: 'unsubscribe'
}, function ( key, api ) {
@yakcode
yakcode / gist:4187020
Created December 2, 2012 04:57
CSS: Image Replacement
/* This is a new way to use image replacement without using text indent to form a box way to the screens */
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@yakcode
yakcode / gist:4187013
Created December 2, 2012 04:51
JavaScript: Sexy PubSub
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind.
// Uses Javascript's new bind function
//Hat tip Paul Irish 'and tuts'
var o = $( {} );
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);
@yakcode
yakcode / gist:4186966
Created December 2, 2012 04:31
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="styles.css">
</head>
<body>