Instantly share code, notes, and snippets.

View unigine-valley.md

Unigine Valley Benchmark 1.0

FPS:
105.6
Score:
4418
Min FPS:
32.9
Max FPS:
176.6

System

View superposition.md

OK, the amount of gotchas with unigine-superposition 1.0-6 benchmark is too damn high, which is a pity because it's awesome!!!

How to run Unigine Superposition Benchmark in ArchLinux

  • download the Linux (.run) version of Qt5.9, the latest version that works https://download.qt.io/official_releases/qt/5.9/5.9.0/
  • make it executable chmod a+x qt-opensource-linux-x64-5.9.0.run
  • run it ./qt-opensource-linux-x64-5.9.0.run
  • skip the registration bit and when prompt about what to install, check Qt5.9 too (top checkbox) and don't change the default path (or do it and adjust following commands). You migt try to not install the tools and see how that goes.
  • use yaourt or pakku / pamac to install pakku -S --needed unigine-superposition and I suggest you do that after a sudo mount -o remount,size=20G,noatime /tmp. If it ends with an error, just sudo pacman -U the-big-tar-file-in-tmp
  • remove the Qt folder inside the unigine-superpos
View rel.js
/*! (c) Andrea Giammarchi - ISC */
const Rel = typeof Map === 'undefined' ?
function () {
const k = [], v = [];
return {
has: value => -1 < k.indexOf(value),
get: value => v[k.indexOf(value)],
set: value => {
const i = k.indexOf(value);
v[i < 0 ? (k.push(value) - 1) : i] = value;
View issue.md

How is ESM in NodeJS able to run any eecutable file as ES2015+ file ?

Example for a generic meta-url file:

#!/usr/bin/env node

console.log(import.meta.url);
View levenshtein.js
// (c) 2018 Andrea Giammarchi
function levenshtein(from, to)
{
const fromLength = from.length + 1;
const toLength = to.length + 1;
const size = fromLength * toLength;
const grid = new Array(size);
let x = 0;
let y = 0;
let X = 0;
View gnome.md

This is a personal reminder about few things I need to remember wheneve I install the most basic Gnome on ArchLinux.

Minimal Installation

bash <(curl -s archibold.io/install/gnome)

The list of installed packages is here.

View debian-on-windows.md

Enable WSL

Search for Turn Windows features on or off and enable Windows Subsytem for Linux

Install Debian from Windows Store

Go to Windows Store and seach for Linux Debian

Install from it, and configure it for the first time.

View esm-in-nodejs.md

Solving the "ESM in NodeJS" Odyssey.

After months of discussions in a dedicated group, it's clear to me NodeJS is still stuck in finding a way to deliver native ESM to its users.

The "usual few" won't hear anything different from .mjs, but .mjs has been demonstrated to be not a solution neither.

Following few cases not covered by .mjs:

  • evaluation of any string, via CLI, or on demand, where there is no extension
  • tools that convert their syntax into JS, since it always worked to date (thanks to transpilers, bundlers, and loaders)
View proxy.js
const proxy = (target, handler) => {
handler = typeof handler === 'object' ?
Object.create(handler) : new handler;
return (handler.proxy = new Proxy(target, handler));
};
View Promise.listeners.js
(function (wm) {'use strict';
// original proposal via Oliver Dunk @oliverdunk_ via ES ML
// (c) Andrea Giammarchi - (ISC)
Object.defineProperties(
Promise.prototype,
{
addListeners: {
configurable: true,
value: function addListeners(resolve, reject) {
var once = wm.get(this);