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
(function($){ | |
$.extend({ | |
loadTmpl: function(url, name, cb){ | |
var c; | |
if (typeof name === "function"){ | |
cb = name; | |
}else if(!cb){ | |
cb = $.noop; | |
} |
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
//dwell click plugin | |
//features: | |
//1-Adds new dwellClick event using a defined time delay | |
//2-optionally make the dwell click act like a regular click, by firing the browser click event | |
//3-Shortcut method $.dwell() well instantiate dwell on body element using | |
//usage: | |
// $(selector).dwell([delay = 500, click = false]) | |
// delay : time to wait with the mouse idle to trigger dwell click | |
// click : trigger original click event | |
// |
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
/****************************************************************************** | |
Without tail-call | |
******************************************************************************/ | |
var times = 0; | |
function test(n) { | |
if (++n >= 10000) { | |
if (++times == 100) console.timeEnd('no-tail') | |
} else { | |
test(n); |
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
//RABIN KARP | |
var BASE = 256, | |
PRIME = 256199087; | |
function tonum(c){ | |
return c.charCodeAt(0); | |
} | |
function mod(a, p, m){ |
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
keywords = ['k', 's', 'i', 'v', 'c', 'd', 'e'] | |
code = '' | |
window.toPrint = '' | |
log = (s)-> window.toPrint += s | |
car = (pair) -> pair[0] | |
cdr = (pair) -> pair[1] | |
cadr = (pair) -> car cdr pair | |
caddr = (pair) -> car cdr cdr pair |
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
/* spiffy links */ | |
// http://www.amazon.com/gp/product/offer-listing/0394756827/ref=dp_pb_a//102-3710615-5652939?condition=all | |
// http://cgibin.erols.com/ziring/cgi-bin/cep/cep.pl?_key=FLooP | |
// http://cgibin.erols.com/ziring/cgi-bin/cep/cep.pl?_key=BLooP | |
// http://www.pdc.kth.se/~jas/retro/retromuseum.html | |
// http://c2.com/cgi/wiki?BloopFloopAndGloop | |
/* parsing variables */ | |
BFloop = (function () { |
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 util = require('util'), | |
spawn = require('child_process').spawn, | |
fs = require('fs'), | |
vm = require('vm'), | |
find = spawn('find', ['./lib', '-name', '*.js']), | |
jsfiles; | |
find.stderr.on('data', function (data) { | |
console.log('something went wrong with find ' + data); | |
process.exit(); |
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
{ | |
controller: "control.js", | |
js: { | |
'myBundle': { | |
wrap: '(function ($) {%s})(jQuery)', | |
scripts: [ | |
{name: 'a.js', wrap: 'funciton a() {%s}'}, | |
{name: 'b.js', wrap: 'func} | |
] | |
} |
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 runMode = function (code, language, elem) { | |
var $elem = $(elem), | |
// MODES is a hash containing all ace modes we support. | |
mode = MODES[lang.toLowerCase()].mode, | |
lines = code.split('\n'), | |
// Tokenizer initial state. | |
last = 'start', |
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
Editor.prototype.setMode = function (language) { | |
this.editor.setMode('mode', language); | |
}; |
OlderNewer