Skip to content

Instantly share code, notes, and snippets.

View ethan605's full-sized avatar

Thanh Nguyen ethan605

View GitHub Profile
@ethan605
ethan605 / !KBD75_REV1_MINIMAL52.md
Last active October 10, 2025 08:31
QMK config for kdb75 rev1 - minimal 52 keys
  1. Follow QMK setup guide to clone qmk_firmware

  2. Configure qmk-cli:

    $ qmk config user.keyboard=kbdfans/kbd75/rev1
    $ qmk config user.keymap=minimal52
    $ qmk config user.qmk_home=/path/to/qmk
  3. Clone this gist to /path/to/qmk/keyboards/kbdfans/kbd75/keymaps/minimal52/

@ethan605
ethan605 / common.sh
Created January 20, 2022 15:44
Common terminal operations
# Find all wayland containers in Sway
swaymsg -t get_tree | jq -r '.. | .app_id?' | grep -v null
# Find all xwayland containers in Sway
swaymsg -t get_tree | jq -r '.. | .instance?' | grep -v null
@ethan605
ethan605 / kbd75.c
Created November 4, 2021 17:14
My KBD75 keymaps
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: Qwerty layer
* ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
*ESCF1F2F3F4F5F6F7F8F9F10F11F12INSDELFN
* ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┤
* │ ` │ 1234567890-=BSPCHOME
* ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬────────┼─────┤
*TABQWERTYUIOP │ [ │ ] │ BSLSEND
* ├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┼─────┤
*LCTRLASDFGHJKL │ ; │ ' │ ENTERPGUP
@ethan605
ethan605 / machine.js
Created April 14, 2021 15:58
Generated by XState Viz: https://xstate.js.org/viz
const trafficLight = Machine({
id: 'trafficLight',
initial: 'red',
states: {
red: {
on: {
TIMER: 'amber'
}
},
amber: {
@ethan605
ethan605 / machine.js
Last active April 14, 2021 15:57
Generated by XState Viz: https://xstate.js.org/viz
const docVideoFlow = Machine({
id: 'docVideo',
type: 'parallel',
states: {
recordState: {
initial: 'hideButton',
states: {
hideButton: {
on: {
NEXT_RECORD_STATE: 'showButton'
@ethan605
ethan605 / !google_chrome_fake_media_stream
Last active December 11, 2021 14:16
Google Chrome with fake media stream
We couldn’t find that file to show.
@ethan605
ethan605 / !nuc_arch_qemu_gpu_passthrough
Last active June 17, 2021 16:02
Intel NUC10i7FNH/K + Arch Linux: QEMU/KVM Windows 10 guest with CPU pinning + GPU passthrough with Intel GVT-g + Hugepages
We couldn’t find that file to show.
@ethan605
ethan605 / cli-template.js
Last active December 11, 2023 19:47
Boilerplate to quickly write a CLI tool with Node.js
#!/usr/bin/env node
/**
* A script to do something handy in an easy way
*
* For more info, run:
* $ <cli-name> --help
*/
'use strict'
export type SystemTypes = 'os' | 'browser';
export type SystemAttribute = {
codeName: string;
name: string;
versionPrefix: string;
};
export type SystemInfo = {
name: string;