This file contains 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 queueExecutionInterval = 200, | |
debug = function (call) { | |
if ("console" in window) { | |
console.log.apply(call); | |
} | |
}, | |
QUEUE = [], | |
SECONDARY = [], | |
functionContainer, primaryThread = setInterval(function () { // QUEUE.push( function ) to register item for queue processing. | |
if (QUEUE.length > 1) { |
This file contains 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 obj1index = obj1.length; | |
for (var obj2index in obj2){ | |
obj1[obj1index] = obj2[obj2index]; | |
obj1index++; | |
} |
This file contains 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
Object.create2 = function(a, b) { | |
var res = Object.create(a); | |
for (var x in b) { if (b.hasOwnProperty(x)) res[x] = b[x]; } | |
return res; | |
} | |
var o = Object.create2(foo, { f:0, g:1, ... }); |
This file contains 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
class Main | |
get "/js/:application.js" do | |
content_type "text/javascript", :charset => "UTF-8" | |
CoffeeScript.compile File.read("app/views/js/#{params[:application]}.coffee") | |
end | |
end |
This file contains 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
jsonp123( | |
{ | |
"//" : "Here comes the callback", | |
"callback": { | |
"//": "This has the first item", | |
"item": { | |
"title": "Databases", | |
"content": { | |
"item": { | |
"//": "Here's where the content is", |
This file contains 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
/*! | |
* jQuery JavaScript Library v1.5.1 | |
* http://jquery.com/ | |
* | |
* Copyright 2011, John Resig | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
* | |
* Includes Sizzle.js | |
* http://sizzlejs.com/ |
This file contains 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
/* | |
* Notes: Optimized for "set" operations | |
* Performance test URL: http://jsperf.com/global-storage-vs-jquery | |
*/ | |
(function($, unknown) { | |
// Usage: Instead of $(elem).data('key'), you use $.storage.get('key') for retrieval. | |
// Usage: Instead of $(elem).data('key', 'value'), you use $.storage.set('key', 'value') for set. | |
$.storage = { | |
get: function(key) { | |
if (typeof $.storage.db == 'undefined') { |
This file contains 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
chrome.extension.onRequest.addListener( | |
function(request, sender, sendResponse) { | |
switch (request.message.action){ | |
case "addSong" : | |
Grooveshark.addSongsByID(request.message.ID, true); | |
break; | |
case "getSong" : | |
var song = GrooveShark.getCurrentSongStatus().song; | |
sendResponse({"songTitle": song}); | |
break; |
This file contains 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 grid; | |
function Grid() { | |
var grid, quadrant, dash, stilt, breaks; | |
dash = '-------------------------'; | |
stilt = '| | | |'; | |
breaks = '\n\r'; | |
quadrant = { |
This file contains 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
// {String} f File name | |
// {Boolean} c Condition | |
// {undefined} [l,j,s] Shortcut for var. | |
var loadjs = function(f,c,l,j,s,a) { | |
a = ((typeof f == 'object')? f : []); | |
f = ((typeof f == 'undefined') ? '' : | |
((typeof f == 'object') ? | |
((typeof f[0] !== 'undefined')? f[0] : '') | |
: f)); | |
l = f.length; |