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
Verifying that +lennym is my openname (Bitcoin username). https://onename.com/lennym |
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
var cats = require('http-status-cats').cats; | |
var vsm = require('lrs/virtualServerModule'); | |
function addRespHandler(req, res, next) { | |
next.on('response', function(clires) { | |
clires.bindHeaders(res); | |
res.setHeader('X-Status-Cat', cats[clires.statusCode]); | |
clires.fastPipe(res); | |
}); | |
next(); |
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
template <typename Container> void tester(int iterations) { | |
srandom(1337); // Seed PRNG to a known value for reproducibility. | |
Container nodesToProcess(1); // Start with the first node to process. | |
for (auto i = 0; i < iterations; ++i) { | |
// Nodes are provided. Isolate and commonize generation. | |
auto rand = random() % 128; // Determine number of nodes at this level. | |
std::vector<typename Container::value_type> nodes(rand); | |
// Process a node. | |
if (!nodesToProcess.empty()) { |