This file contains 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
This is just a gist. |
This file contains 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
package main | |
import ( | |
"flag" | |
"fmt" | |
"github.com/zeromq/gyre" | |
"os" | |
"time" | |
) |
I hereby claim:
- I am afshin on github.
- I am darian (https://keybase.io/darian) on keybase.
- I have a public key whose fingerprint is 62C6 231F F6A4 31F8 57B9 29B6 4B0E 7F36 237A CAFC
To claim this, I am signing this object:
This file contains 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
(function () { | |
var delay = setTimeout.partial(undefined, 10); | |
delay(function () { | |
console.log('A call to this function will be temporarily delayed.'); | |
}); | |
// logs 'A call to this function will be temporarily delayed.' | |
delay(function () {console.log('Some other message.');}); | |
// logs 'Some other message.' | |
})(); |
This file contains 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
(function () { | |
var delay = setTimeout.partial(undefined, 10); | |
delay(function () { | |
console.log('A call to this function will be temporarily delayed.'); | |
}); | |
// logs 'A call to this function will be temporarily delayed.' | |
delay(function () {console.log('Some other message.');}); | |
// logs 'A call to this function will be temporarily delayed.' | |
})(); |
This file contains 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
(function () { | |
var delay = setTimeout.partial(undefined, 10); | |
delay(function () { | |
console.log('A call to this function will be temporarily delayed.'); | |
}); | |
// logs 'A call to this function will be temporarily delayed.' | |
})(); |
This file contains 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
Function.prototype.partial = function () { | |
var fn = this, args = Array.prototype.slice.call(arguments); | |
return function () { | |
var arg = 0; | |
for (var i = 0; i < args.length && arg < arguments.length; i++) | |
if (args[i] === undefined) | |
args[i] = arguments[arg++]; | |
return fn.apply(this, args); | |
}; | |
}; |
NewerOlder