Skip to content

Instantly share code, notes, and snippets.

@GCheung55
GCheung55 / FB.init.detector.js
Created October 25, 2011 19:26 — forked from jiggliemon/FB.init.detector.js
Facebook Init detector!
$(document).bind('FB.ready',function(){
console.log('FB is ready');
FB.api('/me',function(response){
console.log(response);
});
});
var _FB = {
count: 0
,interval : setInterval(function(){
@GCheung55
GCheung55 / Slick.Finder-lite.js
Created January 18, 2012 00:25 — forked from arian/Slick.Finder-lite.js
A lite version of Slick.Finder for modern browsers/mobile.
/*
---
name: Slick.Finder
description: The new, superfast css selector engine.
provides: Slick.Finder
requires: Slick.Parser
...
*/
(function(){
/*
---
name: Browser
description: The Browser Object. Contains Browser initialization, Window and Document, and the Browser Hash.
license: MIT-style license.
requires: [Array, Function, Number, String]
# MooTools snippets
# http://blog.sethladd.com/2012/01/vanilla-dart-ftw.html
## Document is ready
window.addEvent('domready', function(){
//code
});
@GCheung55
GCheung55 / Main.sublime-menu
Created January 26, 2012 00:08
Sublime Text 2 Layouts
/**
* Sublime Text 2 Layouts
* Place file in or modify file if existing
*
* OSX: /Users/ [USERNAME] /Library/Application Support/Sublime Text 2/Packages/User/
* Windows: C:\Users\ [USERNAME] \…\Sublime Text 2\Packages\User
*
*/
[{
@GCheung55
GCheung55 / testGlobal.css
Created January 26, 2012 22:45
Mobile Beginnings for fixed header and native scrolling.
html,
body {
margin: 0 auto;
height: 100%;
// width: 252px;
// width: 320px;
// width: 100%;
// padding: 48px 34px 60px;
}
@GCheung55
GCheung55 / orientationChange.js
Created February 9, 2012 22:34
Mobile Snippets
/**
* Single onOrientationChange attach/detatch.
* This will only attach one orientationchange event.
* Functions attached to the event will be stored in an array to be excuted when the event occurs.
*
* @author Garrick Cheung
*
* @license MIT-style license
*
* @copyright Copyright (c) 2012 [Garrick Cheung](http://garrickcheung.com/)
@GCheung55
GCheung55 / isEqual.js
Created February 14, 2012 21:29
isEqual script to compare two arguments.
var isEqual = function(a, b){
if (a === b) return true;
if (a === void 0 || a === null || b === void 0 || b === null) {
return (a == void 0 && b == void 0);
}
// if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
// return a === b;
// }
@GCheung55
GCheung55 / is.js
Created February 14, 2012 23:02
Compare and equality utility methods
/**
* Comparative and equality utility methods.
* Inspired/influenced/copied from Underscore.js
*/
(function(context){
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty;
@GCheung55
GCheung55 / gist:1903247
Created February 24, 2012 19:45
From prototype to Class
var tmp = function(){};
tmp.prototype = other.prototype;
tmp = new Class({
Extends: tmp,
initialize: function(){
other.apply(this, arguments);
}