Skip to content

Instantly share code, notes, and snippets.

@flaki
flaki / etc_hosts
Created Jun 8, 2020
Host the docs of better-sqlite3 (npm) on a local nginx server for offline access
View etc_hosts
# ...
127.0.0.1 better-sqlite3.docs.local
@flaki
flaki / keybase.md
Created May 30, 2020
Losing your device keys is not fun
View keybase.md

Keybase proof

I hereby claim:

  • I am flaki on github.
  • I am flaki (https://keybase.io/flaki) on keybase.
  • I have a public key ASDptVsyGJDCnWXlX_4xEpwMNA-cxyMsSykHG04M11LTdAo

To claim this, I am signing this object:

@flaki
flaki / mf2-rust-devlog.md
Created May 12, 2019
RustWASM microformats v2 parser implementation - IndieWebCamp Düsseldorf 2019.05.11-12 (devlog)
View mf2-rust-devlog.md

apparently there is no microformats down-to-the-metal parser for microformats (C or Rust or similar) http://microformats.org/wiki/microformats2#Implementations

chewing through the microformats docs/spec http://microformats.org/wiki/microformats2

everything is a classname, prefixes denote the type of content the element has (plaintext, more elements, url attribute) http://microformats.org/wiki/microformats2-prefixes

there is a node/browser parser https://github.com/glennjones/microformat-node

it appears to be nicely tested, this could be used to buid a compliant rust/wasm parser https://github.com/glennjones/microformat-node/blob/master/test/mf-v2-h-card-justaname.js

@flaki
flaki / wasm-cg.md
Last active Apr 17, 2019
WebAssembly CG TLDR
View wasm-cg.md

TL;DR: WebAssembly CG Meeting, April 16, 2019

  • Agenda
  • Dan Gohman, Mozilla was voted to Chair the WASI subgroup with unanimous consent
  • Proposal for a second chair (Co-chair), Sam Clegg, Google volunteered but decision was postponed until the next meeting
  • A vote was proposed for adopting the WASI subgroup charter and was accepted without objections
  • A vote was proposed for landing the reference libc implementation for WASI, but eventually postponed. The implementation uses MUSL that is MIT licensed, with no precedence of MIT-licensed code in the codebase before. Vote was postponed until after consulting with legal for guidance on this, and the various other licenses in use/included currently.
@flaki
flaki / clouduboy-workshop-docs.md
Last active May 15, 2018
Clouduboy Workshop Docs
View clouduboy-workshop-docs.md
@flaki
flaki / doggo.microcanvas.js
Created Mar 10, 2018
Tamagotchi with MicroCanvas
View doggo.microcanvas.js
"use strict";
let game = new MicroCanvas();
let gfxGotchi, gfxGotchiFlip, gfxBone;
game.setup(function(game) {
gfxGotchi = game.loadSprite(`! gotchi 16x16
##............##
.#.....###.#####
@flaki
flaki / README.md
Created Jan 30, 2018
Clouduboy perf timing demo for the Arduboy
View README.md

Clouduboy perf timing demo

The interesting bits are:

game.custom({
  arduboy: `{ long now=millis()`
});

// and
@flaki
flaki / undefined.js
Created Apr 5, 2017
Shadowing undefined
View undefined.js
(function() {
// Won't work, 'undefined' is a property on the global object, but it's unconfigurable (not modifiable)
try {
Object.defineProperty(window, 'undefined', { value: 42 });
} catch (e) { console.log(e.toString()) }
// But 'undefined' could be still shadowed, because it's not a keyword - its name is usable as an identifier
var undefined = 42;
// foo is a non-existent property on the window object
@flaki
flaki / README.md
Last active Mar 23, 2017
Animate the Mozilla.org CSS Grid demo!
View README.md

How To Use?

  1. Navigate to Mozilla.org's CSS Grid demo page
  2. In Firefox, open devtools and create a new stylesheet. Copy grid-logo-animate.css's contents in there!
    • Alternatively you can copy/paste grid-logo-animate.js into the devtools console and hit enter—this should work in any browser.
  3. Hover the logo, watch it fade away.
  4. Lean back, move your cursor off the logo, and enjoy!
@flaki
flaki / quickstart.md
Created Jan 20, 2017
How to node on the PocketCHIP
View quickstart.md

How to node on the PocketCHIP?

Install node.js

Install node from NodeSource PPA

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
You can’t perform that action at this time.