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
// @ts-check | |
const crypto = require('crypto') | |
const start = Date.now() | |
const captureHash = i => { | |
crypto.pbkdf2("test", "test", 100000, 512, "sha512", () => { | |
console.log(`capture ${i} at ${Date.now() - start}`) | |
}) | |
} |
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
# make sure to update this glob for your poject | |
for file in ./**/src/**/*.{re,rei}; do | |
[ -f "$file" ] || break | |
FILENAME=$(basename -- "$file") | |
BASENAME=${FILENAME%%.*} | |
DIRNAME=$(dirname $file) | |
echo "$file" | |
if [ ${file: -3} == ".re" ]; then |
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 Benchmark = require("benchmark"); | |
const Caml_obj = require("bs-platform/lib/js/caml_obj.js"); | |
const Belt_SortArray = require("bs-platform/lib/js/belt_SortArray.js"); | |
const Js_math = require("bs-platform/lib/js/js_math.js"); | |
const suite = new Benchmark.Suite("arrays", { | |
minSamples: 1000, | |
}); |
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 data: any = [] | |
export async function imageToPixels(buffer: Buffer) { | |
const resizedBuffer = await sharp(buffer) | |
.resize(64, 64) | |
.toBuffer() | |
const image = jpeg.decode(resizedBuffer, true) | |
const numChannels = 3; | |
const numPixels = image.width * image.height; |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |