This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello World |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello World |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Web Workers can be built from data URLs! | |
// See http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#dom-worker | |
// Chrome doesn't seem to support this yet but FF does | |
// So how about a helper to create a Web Worker from a function | |
var InlineWorker = (function() { | |
var r_func = /^\s*function\s*\(.*?\)\s*\{|\}\s*$/g; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Event = (function( $ ) { | |
var cache = {}, | |
slice = [].slice, | |
fake = { | |
remove: $.noop, | |
fireWith: $.noop | |
}; | |
function get( ev, createIfNeeded ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remember to change every instance of "pluginName" to the name of your plugin! | |
// the semicolon at the beginning is there on purpose in order to protect the integrity of your scripts when | |
// mixed with incomplete objects, arrays, etc. | |
;(function( $ ) { | |
// plugin's default options | |
// this is private property and is accessible only from inside the plugin | |
var defaults = { | |
propertyName : 'value' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getName = (function() { | |
var cache; // private cache | |
// gets assigned to getName | |
return function() { | |
// return the cache if it's valid or | |
return cache || $.ajax({ | |
url: 'srv/echo', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create type-related methods: | |
// isArray, isBoolean, isDate, isFunction, isObject, isNumber, isRegExp, isString and type | |
jQuery.isFunction = jQuery.noop; | |
jQuery.each( "Array Boolean Date Function Object Number RegExp String ".split(" "), function( lName, name ) { | |
lName = class2type[ "[object " + name + "]" ] = name.toLowerCase(); | |
jQuery[ name ? ( "is" + name ) : "type" ] = nativeTypeTests[ name ] || function( value ) { | |
value = value == null ? | |
String( value ) : | |
class2type[ toString.call( value ) ] || "object"; | |
return name ? ( value === lName ) : value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
## Nav data, as a JSON heredoc. Much less verbose than PHP arrays! | |
$navs = json_decode(<<<JSON | |
{ | |
"mlb": { | |
"title_link": "http://stats.boston.com/mlb/scoreboard.asp", | |
"nav": [ | |
{ "title": "Full Schedule", "url": "http://stats.boston.com/mlb/teamreports.asp?tm=02&report=schedule" }, | |
{ "title": "Statistics", "url": "http://stats.boston.com/mlb/teamreports.asp?yr=2009&tm=2&btnGo=Go&report=stats" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var toString = Object.prototype.toString; | |
var class2type = { | |
"[object Boolean]": "boolean", | |
"[object Number]": "number", | |
"[object String]": "string", | |
"[object Function]": "function", | |
"[object Array]": "array", |