Last active
August 29, 2015 14:05
-
-
Save evilpacket/f9f065b2796e95528f00 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
| // USAGE: node buf.js output_file buffer_size iteration | |
| // Example: node buf.js derp 51200 1000 | |
| var fs = require('fs'); | |
| var file = process.argv[2]; | |
| var size = Number(process.argv[3]); | |
| var thinger = []; | |
| fs.open(file, 'w', function (err, fd) { | |
| for (var i=0; i<process.argv[4];i++) { | |
| var buf = new Buffer(size); | |
| thinger.push[buf]; | |
| fs.writeSync(fd, buf, 0, buf.length); | |
| } | |
| fs.close(fd); | |
| }); |
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 express = require('express'); | |
| var app = express(); | |
| app.get('/test', function(req, res){ | |
| console.log(req.query); | |
| res.send("HELLO LNUG"); | |
| }); | |
| var server = app.listen(3000, function() { | |
| console.log('Listening on port %d', server.address().port); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment