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
@dominykas
dominykas / grid.html
Last active January 2, 2016 20:19
Scrolly Grid
<html>
<head>
<title>Scrolly grid test</title>
<style>
.container {
padding: 4px;
width: 600px;
background-color: rgba(0,0,0,.1);
-moz-box-sizing: border-box;
@dominykas
dominykas / trackingCookie.js
Created January 9, 2014 07:05
Tracking cookie for hapi
var uuid = require("node-uuid");
var TRACKING_COOKIE_NAME = "trackingId";
var UUID_REGEX = /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;
module.exports.register = function (server) {
server.state(TRACKING_COOKIE_NAME, {
ttl: 2 * 365 * 86400 * 1000,
path: "/"
});