Skip to content

Instantly share code, notes, and snippets.

View WebReflection's full-sized avatar
🎯
Focusing

Andrea Giammarchi WebReflection

🎯
Focusing
View GitHub Profile
@WebReflection
WebReflection / lys.js.md
Last active March 21, 2019 22:05
A `lys.js` crazy non sense

lys is a programming language that produces WASM, and its design goal is to be as simple as possible, yet useful to create utilities.

I've been thinking about a subset of JavaScript that could run natively on the browser, similarly to asm.js, but with the ability, through a dedicated parser, to target another language able, on its own, to produce WASM.

The following crazy non sense works already thanks to an agglomerated of modern and deprecated JS features and it might be interesting as experiment to see if a JS to WASM compiler, through the lys indirection, could be possible.

function lys(fn) {

  /*! (c) Andrea Giammarchi */
@WebReflection
WebReflection / pc-2-pi.md
Last active September 27, 2024 08:50
How to configure aarch64 Raspberry Pi 3 on ArchLinux

PC Setup

To make this possible you need qemu static built for other architectures. Be sure the following works before going any further here.

alias aur=pakku|yay|yaourt
aur -Sy --needed --noconfirm qemu-user-static # + deps, if proposed
# binfmt-qemu-static
@WebReflection
WebReflection / porn.js
Last active March 2, 2019 12:14
⚠ NSFW + Warning: You Cannot Unsee ⚠
/*! porn.js (NSFW) */
let Ɛ = 'b';
()=> {} // Shemale // arrow
()=>{} // // arrow
Ɛ=> {} // Straight // arrow
Ɛ=>{} // // arrow
@WebReflection
WebReflection / index.js
Last active November 20, 2018 19:03
hyperHTML does Cloudflare Worker
const basicHTML = require('basichtml');
basicHTML.init();
document.documentElement.setAttribute('lang', 'en');
const {bind} = require('hyperhtml');
const model = {
index: {
title: 'hyperHTML does Cloudflare too',
h1: {
@WebReflection
WebReflection / superposition.md
Last active May 5, 2020 02:32
How to run Unigine Superposition Benchmark in ArchLinux

OK, the amount of gotchas with unigine-superposition 1.1 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 yay, 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-super
/*! (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;
@WebReflection
WebReflection / levenshtein.js
Created September 5, 2018 11:33
Levenshtein distance
// (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;
@WebReflection
WebReflection / gnome.md
Last active February 5, 2025 19:16
Minimal GNOME Setup for ArchLinux

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 https://archibold.io/install/gnome)

This will install automatically pamac-aur, Firefox, and many other common software so that the rest of this document could be ignore.

@WebReflection
WebReflection / debian-on-windows.md
Last active March 29, 2020 05:24
Debian on Windows

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.

@WebReflection
WebReflection / esm-in-nodejs.md
Last active October 20, 2021 14:54
Solving the "ESM in NodeJS" Odyssey.

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)