Skip to content

Instantly share code, notes, and snippets.

View maxnordlund's full-sized avatar

Max Nordlund maxnordlund

View GitHub Profile
@maxnordlund
maxnordlund / benchmark.js
Last active September 27, 2018 12:19
Quick micro benchmark regarding passing of arguments
module.exports = exports = benchmark
function benchmark(size, fn, name) {
console.time("benchmark " + name)
var result = 0
for (var i = 0; i < size; ++i) result = fn(result, i)()
console.timeEnd("benchmark " + name)
console.log(result)
// Disable stealthy-require as it breaks ESM in modernish node
// 1. Load stealthy-require into the require cache. This way all the module
// machinery gets run like normal.
require("stealthy-require")
// 1. Overwrite the real function with a dummy one
require.cache[require.resolve("stealthy-require")].exports = notSoSthealthyRequire
// 3. Dummy implementation that calls the provided callbacks in the right order
@maxnordlund
maxnordlund / keybase.md
Created August 8, 2019 11:03
Keybase proof

Keybase proof

I hereby claim:

  • I am maxnordlund on github.
  • I am maxnordlund (https://keybase.io/maxnordlund) on keybase.
  • I have a public key ASBnMu1IGUACj7EGUL_RjMcu4g856OgXkYI9Yy0o_tFfsQo

To claim this, I am signing this object: