Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominykas Blyžė dominykas

View GitHub Profile
View xnif.js
#!/usr/bin/env node
const args = process.argv.slice(2);
const [modfn, ...params] = args;
const [mod, fn] = modfn.split('.');
const Mod = require(mod);
View v12.15.0.txt
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%
View .npmrc
package-lock=true
shrinkwrap=true
View stress-of-success.md
View node-modules-age.sh
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 Apr 5, 2018
hapi/nes empty response
View output.txt
GET /null
nes null
wreck + json null
GET /null-with-json-header
nes null
wreck + json null
GET /null-with-text-header
nes null
View split-economist.sh
#!/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
View tangoDecrypt.js
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;
View index.js
var one = ejs.compile("one.ejs"),
two = ejs.compile("two.ejs");
console.log(one({ myData: "ohai", two: two }));