I hereby claim:
- I am jontyy on github.
- I am jontyy (https://keybase.io/jontyy) on keybase.
- I have a public key whose fingerprint is E95A 98A4 DB2F EE78 8D62 D59E 60AB 7D74 2FD0 3754
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| var CallbackQueue = (function(){ | |
| var Worker = function(queue){ | |
| this.queue = queue; | |
| this.working = false; | |
| }; | |
| Worker.prototype.done = function(){ | |
| this.working = false; | |
| this.work(); | |
| }; | |
| Worker.prototype.work = function(){ |
| module.exports = function(grunt) { | |
| "use strict"; | |
| grunt.loadNpmTasks('grunt-contrib-jshint'); | |
| grunt.initConfig({ | |
| // JSHint Configuration | |
| // http://www.jshint.com/docs/ | |
| // | |
| // All of the options can be placed in a .jshintrc, update options : { jshintrc : ".jshintrc" } |
| //jQuery.reduce.js - https://github.com/jontyy - MIT licensed | |
| jQuery.reduce = function(arr, func, initial){ | |
| initial = typeof initial === 'undefined' ? 0 : initial; | |
| for(var i in arr){if(arr.hasOwnProperty(i) && !isNaN(parseInt(i,10))){ | |
| initial = func(initial,arr[i],i); | |
| }} | |
| return initial; | |
| }; |
| //usage: http://jsbin.com/ucucuc | |
| var debounce = function(delay,callback){ | |
| var timeout; | |
| //$().keyup(debounce()) will be this function, it still has access to timeout because of closure | |
| return function(){ | |
| var that = this,args = arguments, | |
| delayed = function(){ | |
| callback.apply(that, args); | |
| timeout = null; |