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
| var util = require('util'), | |
| EventEmitter = require('events').EventEmitter; | |
| var Server = function() { | |
| var self = this; | |
| this.on('custom_event', function() { | |
| self.logSomething('custom_event'); | |
| }); |
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
| // SICP 3.5.2: https://sarabander.github.io/sicp/html/3_002e5.xhtml#g_t3_002e5_002e2 | |
| // Node v0.10.31 | |
| var stream = require('stream'); | |
| var getPrimes = function (count) { | |
| integers(2) | |
| .pipe(primes()) | |
| .pipe(take(count)) |
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
| struct rBuffer { | |
| unsigned char *buffer; | |
| uint8_t head; | |
| uint8_t tail; | |
| uint8_t count; | |
| }; | |
| struct rBuffer *newRingBuffer(uint8_t length) { | |
| unsigned char *buffer= (unsigned char *)malloc(length); | |
| static struct rBuffer temp= {buffer,0,0,0}; |