View factory.js
function createObject (clazz, args) { | |
var o; | |
if (Object.create) { | |
o = Object.create(clazz) | |
clazz.constructor.apply(xx, args); | |
} else { | |
// screwed! nothing other than evil-eval :-( | |
o = eval("new " + clazz.constructor.name + "(" + args + ")"); | |
} | |
} |
View qr-pure-js.js
(function() { | |
function cssAsNum(width){ | |
return Number(width.replace("px","")) | |
} | |
var body,img; | |
body = document.body; | |
img = document.createElement("img"); | |
img.style.userSelect = "none"; | |
img.style.position = "fixed"; | |
img.style.zIndex = 999999; |
View jquery.ui.widget-(partial).js
$.widget.bridge = function( name, object ) { | |
var fullName = object.prototype.widgetFullName || name; | |
$.fn[ name ] = function( options ) { | |
var isMethodCall = typeof options === "string", | |
args = slice.call( arguments, 1 ), | |
returnValue = this; | |
// allow multiple hashes to be passed on init | |
options = !isMethodCall && args.length ? | |
$.widget.extend.apply( null, [ options ].concat(args) ) : |
View Benchmark.coffee
_avg = (items) -> | |
sum = 0 | |
sum += item for item in items | |
sum / items.length | |
class Benchmark | |
constructor: (@functions,@maxSampling) -> | |
@check() | |
check: () -> |
NewerOlder