Skip to content

Instantly share code, notes, and snippets.

View dominykas's full-sized avatar

Dominykas Blyžė dominykas

View GitHub Profile
#!/usr/bin/env node
const args = process.argv.slice(2);
const [modfn, ...params] = args;
const [mod, fn] = modfn.split('.');
const Mod = require(mod);
@dominykas
dominykas / v12.15.0.txt
Created April 28, 2020 09:03
runtime stats
Runtime Function/C++ Builtin Time Count
========================================================================================
JS_Execution 6222.59ms 29.35% 503037 3.41%
GC_MC_BACKGROUND_MARKING 2808.84ms 13.25% 138 0.00%
FunctionCallback 2007.30ms 9.47% 303771 2.06%
GC_SCAVENGER_BACKGROUND_SCAVENGE_PARALLEL 1764.63ms 8.32% 985 0.01%
RecompileConcurrent 1564.55ms 7.38% 559 0.00%
GC_MC_BACKGROUND_SWEEPING 722.36ms 3.41% 157 0.00%
GC_SCAVENGER_SCAVENGE_PARALLEL 471.87ms 2.23% 408 0.00%
Map_TransitionToDataProperty 401.26ms 1.89% 1874272 12.70%
@dominykas
dominykas / .npmrc
Last active December 6, 2019 14:29
package-lock=true
shrinkwrap=true
node_modules_age() {
FOLDER="node_modules"
if [[ ! -d ${FOLDER} ]]; then
exit
fi
MTIME=$(stat -t %s -f %B -- ${FOLDER})
@dominykas
dominykas / output.txt
Last active April 5, 2018 10:59
hapi/nes empty response
GET /null
nes null
wreck + json null
GET /null-with-json-header
nes null
wreck + json null
GET /null-with-text-header
nes null
#!/bin/bash
SUFFIX=$(date +%m%d)
BASE_FOLDER="./split-economist-${SUFFIX}"
ISSUES=($(find ~/Downloads/Issue*.zip -type f))
if [[ ${#ISSUES[@]} != 1 ]]; then
echo "Could not find exactly 1 Economist issue zip";
exit 1
var forge = require("node-forge");
function trimZeroes(data) {
return data.toString().replace(/^\0+/, "").replace(/\0+$/, "");
}
function tangoDecrypt(tangoHash, tangoSharedSecret) {
var decodedKey = new Buffer(tangoSharedSecret, "base64");
var ivSize = decodedKey.length;
var one = ejs.compile("one.ejs"),
two = ejs.compile("two.ejs");
console.log(one({ myData: "ohai", two: two }));