Skip to content

Instantly share code, notes, and snippets.

@iFwu
iFwu / machine.js
Last active August 17, 2020 09:06
Generated by XState Viz: https://xstate.js.org/viz
const transTo = (target) => ({
target,
actions: sendParent({ type: 'TODO_STATUS_UPDATE', value: target }),
});
const todoStatusMachine = Machine({
id: 'TodoStatus',
states: {
Active: {
on: {
import {Number} from "ts-toolbelt"
type Even_<a extends string> = {
0: true,
1: false,
2: Even_<Number.Minus<a, "2">>
}[a extends "0" ? 0 : a extends "1" ? 1 : 2]
type Even<a extends number> = a extends unknown ? Even_<Number.NumberOf<a>> : never
type AssertEven<a extends any[]> = Even<a["length"]> extends true ? a : unknown

Keybase proof

I hereby claim:

  • I am ifwu on github.
  • I am nicesprite (https://keybase.io/nicesprite) on keybase.
  • I have a public key ASBg0axWWnoiputR8Aohw7w3aDMyPE3cRJlKBiMc5SfEPQo

To claim this, I am signing this object:

@iFwu
iFwu / gist:521d6eb75b77d766bcadb30003246a32
Created July 29, 2025 17:04
Karabiner-Elements Configuration Examples
{
"profiles": [
{
"name": "custom",
"selected": true,
"virtual_hid_keyboard": {
"caps_lock_delay_milliseconds": 300,
"keyboard_type": "ansi"
},
"complex_modifications": {