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 http = require('http'); | |
http.createServer( | |
function(request, response) { | |
request.pause(); | |
response.writeHead(200, { 'Content-Type': 'text/plain' }); | |
response.write('now press CMD + R and every other request will hang for 2 minutes before returning'); | |
response.end(); | |
} | |
).listen(4000); |
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 constants = require('constants'); | |
var fs = require('fs'); | |
var https = require('https'); | |
// Modified form of current io.js default ciphers which gets A+ on ssllabs (assuming SHA256 certificate signature). | |
// Downside is it's not explicit which would be much better. | |
var ciphersImplicit = [ | |
'ECDHE-RSA-AES128-GCM-SHA256', | |
'ECDHE-RSA-AES128-SHA256', | |
'ECDHE-RSA-AES128-SHA', |
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 constants = require('constants'); | |
var fs = require('fs'); | |
var https = require('https'); | |
// Fedor's explicit cipher list. | |
// Good to see AES256 at the top of the list. | |
// Perhaps all the ECDHE ciphers should be moved above the DHE ciphers? | |
// Is the DES-CBC3-SHA necessary? | |
// Does not get A+ on ssllabs. | |
// Missing forward secrecy for IE and Safari reference browsers. |
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
#!/bin/bash | |
# Invoke this script with a relative '.app' path, for example: | |
# codesign-electron.sh "darwin-x64/Electron.app" | |
# 1. Run the following command to get a list of identities: | |
# security find-identity | |
# 2. Now set the value of the identity variable below to the identity you want to use: | |
identity="Developer ID Application: ... (...)" |
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 Node = { | |
child: require('child_process'), | |
fs: require('fs'), | |
path: require('path') | |
}; | |
// This will be removed and then created and then removed: | |
var testdirectory = 'testfswatchmisses'; | |
if (Node.fs.remove !== undefined) throw new Error('fs.remove exists'); |
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 fs = require('fs'); | |
var path = require('path'); | |
/* | |
This test is designed for Windows, and tests whether changed folder events | |
are emitted on time or after several seconds delay (up to 40 seconds or more). | |
This requires renaming a file at least two subfolders deep relative to the | |
watched folder. Renaming a file only one subfolder deep will not reproduce | |
the slow behavior. |
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 path = require('path'); | |
var fs = require('fs'); | |
// Be careful of adding in console.log statements as these can | |
// influence the outcome of the script on Windows and cause it to pass. | |
process.on('uncaughtException', function(error) { | |
console.log('error: ' + error); | |
}); |
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
setInterval( | |
function() { | |
}, | |
1000 | |
); | |
var array = []; | |
array.push(new Buffer(12189696)); | |
array.push(new Buffer(629145600)); |
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 fs = require('fs'); | |
function callback(error) { | |
if (error) { | |
console.error(error); | |
process.exit(1); | |
return; | |
} | |
if (++count >= 1000000) { | |
console.log((Date.now() - now) + 'ms'); |
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
const DirectIO = require('@ronomon/direct-io'); | |
const Node = { | |
fs: require('fs'), | |
path: require('path'), | |
process: require('process') | |
}; | |
const PATH = '\\\\.\\PhysicalDrive1'; | |
// 4096 is better than 512 because it works with new Advanced Format devices: |
OlderNewer