Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Andrea Giammarchi WebReflection

🎯
Focusing
Block or report user

Report or block WebReflection

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View why-i-use-web-components.md

Why I use web components

This is some sort of answer to recent posts regarding Web Components, where more than a few misconceptions were delivered as fact.

Let's start by defining what we are talking about.

The Web Components Umbrella

As you can read in the dedicated GitHub page, Web Components is a group of features, where each feature works already by itself, and it doesn't need other features of the group to be already usable, or useful.

@WebReflection
WebReflection / utils.md
Last active May 16, 2019
Some commonly re-used / needed bash utils
View utils.md

./find module-name

Placed on the root of all git repositories, and made executable via chmod +x find, this utils displays folders with a package.json that depends on it.

#!/usr/bin/env node

// ./find module-name
// simple utility to find folders depending on module-name
// by Andrea Giammarchi - @webreflection
@WebReflection
WebReflection / custom-elements-pattern.md
Last active Aug 15, 2019
Handy Custom Elements' Patterns
View custom-elements-pattern.md

Handy Custom Elements' Patterns

Ricardo Gomez Angel Photo by Ricardo Gomez Angel on Unsplash

This gist is a collection of common patterns I've personally used here and there with Custom Elements.

These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.

@WebReflection
WebReflection / wallpapers.md
Last active Jun 18, 2019
Personal collection of wallpapers from unsplash
View wallpapers.md

Random Wallpapers is awesome, but it also keeps changing wallpapers (which is what I like about it).

This is a collection of wallpapers I liked the most, specially suitable for dark theme mode.

Jonatan Pie Photo by Jonatan Pie on Unsplash


Alberto Restifo

@WebReflection
WebReflection / executable-standalone-module.md
Last active Jul 23, 2019
NodeJS Executable Standalone Module
View executable-standalone-module.md

About

In this tweet I've shown how the incoming version of NodeJS could be used to run a standalone file as ESM through the flag --input-type=module.

The technique would work for files without an extension, like myprogram, as well as files with any extension, including myprogram.js, myprogram.mjs, myprogram.exe, or myprogram.iscool.

This gist is an attempt to describe the technique I've used.

Special thanks to Geoffrey Booth for hints, suggestions, and review of this content.

View bytecode.md

Bytecode And Web

Coming from this tweet: https://twitter.com/mathias/status/1115525813670227968

Similar way scripts with type module has been introduced, script with type bytecode and a specific engine target, including wasm, could make it too, so that engines able to digest pre-optimized code can benefit from this.

<script type="bytecode" engine="v8" src="v8.bc"></script>
<script type="bytecode" engine="spidermonkey" src="sm.bc"></script>
<script type="bytecode" engine="jsc" src="jsc.bc"></script>
@WebReflection
WebReflection / lys.js.md
Last active Mar 21, 2019
A `lys.js` crazy non sense
View lys.js.md

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 Mar 18, 2019
How to configure aarch64 Raspberry Pi 3 on ArchLinux
View pc-2-pi.md

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 binfmt-qemu-static

Disk Setup

You can’t perform that action at this time.