Skip to content

Instantly share code, notes, and snippets.

View zwang008's full-sized avatar

Zhaojie Wang zwang008

  • teambition
  • Shanghai, CN
View GitHub Profile
@zwang008
zwang008 / gist:91b7c5f5cc1124211f87
Last active August 29, 2015 14:01 — forked from yakcode/gist:4186966
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
@zwang008
zwang008 / gist:547228598bf4229b3a77
Last active August 29, 2015 14:01 — forked from yakcode/gist:4187013
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);
@zwang008
zwang008 / gist:dfcbc44d32aac98c61be
Last active August 29, 2015 14:01 — forked from yakcode/gist:4187020
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;
}
@zwang008
zwang008 / gist:0afa35c9269540002f0f
Last active August 29, 2015 14:01 — forked from yakcode/gist:4187044
JavaScript: JQuery PubSub
//Jquery version of using pubsub
(function($) {
var o = $( {} );
$.each({
on: 'subscribe',
trigger: 'publish',
off: 'unsubscribe'
}, function ( key, api ) {