Skip to content

Instantly share code, notes, and snippets.

View imdongchen's full-sized avatar

Dong Chen imdongchen

  • Robinhood
  • USA
View GitHub Profile
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
@imdongchen
imdongchen / 0_reuse_code.js
Created April 5, 2017 18:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console