Last active
August 30, 2016 00:59
-
-
Save skt-t1-byungi/289691475c6cdb5042dd4a2b5f6bf02c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
_.mixin({ | |
deparam: function(querystring) { | |
querystring = querystring.substring(querystring.indexOf('?') + 1).split('&'); | |
var params = {}, | |
pair, d = decodeURIComponent, | |
i; | |
for (i = querystring.length; i > 0;) { | |
pair = querystring[--i].split('='); | |
params[d(pair[0])] = d(pair[1]); | |
} | |
return params; | |
}, | |
waitQueue: function(fn, time) { | |
var waitNum = 0; | |
time = time || 0; | |
return function() { | |
var caller = this, | |
args = arguments; | |
waitNum++; | |
setTimeout(function() { | |
fn.apply(caller, args); | |
waitNum--; | |
}, (waitNum - 1) * time); | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment