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);
View proto-classic.js
const bench = {
stress: 10e2,
times: 5,
classical(copy, overwrite) {
this._prototype = false;
this._bootstrap(copy, overwrite);
},
prototypal(copy, overwrite) {
this._prototype = true;
this._bootstrap(copy, overwrite);
View esx-in-browsers.md

A list of screen shots for browsers capabilities

View custom-elements-shenanigans.html
<!doctype html>
<html>
<head>
<script>
class Logger extends HTMLElement {
connectedCallback() {
console.log(`<${
this.nodeName.toLowerCase()
}> has ${
View mix.js
// now an npm package qith 100% code coverage:
// https://github.com/WebReflection/endow#endow---
// (c) Andrea Giammarchi, @WebReflection (ISC)
const mix = Super => ({
with: (...mixins) =>
mixins.reduce(
(Class, Mixin) => {
Class = Mixin(Class);
if (!Mixin.hasOwnProperty(Symbol.hasInstance)) {
View fsb.js
#!/usr/bin/env gjs
// (c) Andrea Giammarchi - ISC
// define the Gtk version to use
imports.gi.versions.Gtk = '3.0';
((Gtk, Gdk, WebKit2) => {
Gtk.init(null);
View hyper-lit.md

The history of hyperHTML followed by lit-html

While many remember the epic hyperHTML: A Virtual DOM Alternative post I've published the 5th of March 2017, the first official implementation of the library was working as hyperHTML.bind(node) function for tagged literals the day before, and it's been in my experiments folder already for a little while.

The hilarious reaction from the skeptical community

At first glance people couldn't believe performance of the DBMonster demo shown in that article,