Skip to content

Instantly share code, notes, and snippets.

View rupert-ong's full-sized avatar

Rupert Ong rupert-ong

  • Toronto, Ontario
View GitHub Profile
@rupert-ong
rupert-ong / ajaxify-html5.js
Created September 25, 2012 14:03 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@rupert-ong
rupert-ong / 0_selector_hacks.scss
Created September 5, 2012 18:17 — forked from chriseppstein/0_selector_hacks.scss
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
@rupert-ong
rupert-ong / snippet.js
Created July 9, 2012 14:44 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@rupert-ong
rupert-ong / gist:2022605
Created March 12, 2012 15:22
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}