Skip to content

Instantly share code, notes, and snippets.

View igstan's full-sized avatar

Ionuț G. Stan igstan

View GitHub Profile
// The `quickEach` method will pass a non-unique jQuery instance
// to the callback meaning that there will be no need to instantiate
// a fresh jQuery instance on each iteration. Most of the slow-down
// inherent in jQuery's native iterator method (`each`) is the constant
// need to have access to jQuery's methods, and so most developers
// see constructing multiple instances as no issue... E.g.
// $(...).each(function(){ $(this)... $(this)... $(this)... });
// A better approach would be `quickEach`.
jQuery.fn.quickEach = (function(){
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
// BNF parser framework for JavaScript
// Oleg Andreev
var result = (function(text){
// The Y Combinator
var Y=function (gen) {
return function(f) {return f(f)}(
function(f) {
return gen(function() {return f(f).apply(null, arguments)})})}