Skip to content

Instantly share code, notes, and snippets.

@flaki
flaki / README.md
Created January 30, 2018 06:43
Clouduboy perf timing demo for the Arduboy

Clouduboy perf timing demo

The interesting bits are:

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

// and
@flaki
flaki / doggo.microcanvas.js
Created March 10, 2018 14:51
Tamagotchi with MicroCanvas
"use strict";
let game = new MicroCanvas();
let gfxGotchi, gfxGotchiFlip, gfxBone;
game.setup(function(game) {
gfxGotchi = game.loadSprite(`! gotchi 16x16
##............##
.#.....###.#####
@flaki
flaki / clouduboy-workshop-docs.md
Last active May 15, 2018 16:13
Clouduboy Workshop Docs
@flaki
flaki / wasm-cg.md
Last active April 17, 2019 00:46
WebAssembly CG TLDR

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 / mf2-rust-devlog.md
Created May 12, 2019 13:31
RustWASM microformats v2 parser implementation - IndieWebCamp Düsseldorf 2019.05.11-12 (devlog)

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 / keybase.md
Created May 30, 2020 11:06
Losing your device keys is not fun

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 / etc_hosts
Created June 8, 2020 10:44
Host the docs of better-sqlite3 (npm) on a local nginx server for offline access
# ...
127.0.0.1 better-sqlite3.docs.local
@flaki
flaki / postcss-generate.js
Created October 21, 2020 11:25
Generate minified, source-mapped PostCSS output
const postcss = require('postcss');
const sourcemapConcat = require('concat-with-sourcemaps');
const fs = require('fs-extra');
const { dirname, basename } = require('path');
let CONFIG;
try {
// Throws if no config file
@flaki
flaki / rfg-corpus.txt
Last active January 11, 2021 22:00
Testing Mozilla DeepSpeech for a Waasabi live transcription usecase
10 000 STEPS MIGHT SEEM LIKE A LOT BUT IF YOU NEED TO PLACE 100 BRUSHES THAT IS 8 000 PARAMETERS AND REMEMBER THE ALGORITHM CANNOT REMOVE THEM
20% OF ALL THE CRATES THAT ARE IN CRATES IO USE THEM SAFE DIRECTLY
25 28 29
27 IS NOT A POP
61 AND 62 ARE THE ADDRESSES OF THE SPECIAL REGISTERS FOR THE FRAME POINTER
95% CHANCE THE BUG IS IN THE CODE YOU JUST WROTE
A BAT SENDS SOUND WAVES EVERY NOW AND THEN AND WAITS FOR THEM TO RETURN TO CALCULATE HOW FAR IS IT FROM AN OBSTACLE
A BRIEF OVERVIEW OF THE SYSTEM ARCHITECTURE
A CHANGE IN THE ALGORITHM DOES NOT NECESSARILY REQUIRE A CHANGE TO THE DATA
A CHECKMARK GOES TO THE BEST AND AN X TO THE WORSE AND NO MARK FOR THE COMPRESSOR IN BETWEEN
@flaki
flaki / sed-update-env.sh
Last active March 14, 2024 10:42
sed script for updating a variable in place or appending it to an existing .env file
# Script for updating a var in an .env file
# (will add it to the end of the file, if not found)
sed -in '
# If a line contains our variable, continue at :set
s/^ENV_VAR=.*$//; t set
# Otherwise if this is the last line, check the hold space
# If hold space is empty, no substitution occured, we need
# to manually add the line at the end of the .env file
$ { x; /^$/ { x; p; b set }; d }
# Just print non-matching lines