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
fn stack_or_result_location_semantics() custom_struct { | |
var custom_structs: [1]custom_struct = undefined; | |
fill_in_custom_struct(&custom_structs, 1); | |
return custom_structs[0]; | |
} | |
fn boom_or_safe() void { | |
var custom_struct = stack_or_result_location_semantics(); | |
} |
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
#include <assert.h> | |
#include <limits.h> | |
#include <node_api.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
static int arg_buf( | |
napi_env env, | |
napi_value value, |
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
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: |
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 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 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 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 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 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 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 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. |
NewerOlder