Skip to content

Instantly share code, notes, and snippets.

View shirohana's full-sized avatar

Hana Shiro shirohana

View GitHub Profile
@shirohana
shirohana / eventtaps.sh
Created August 22, 2026 05:38
Reports the CGEventTap chain and flags leaks
#!/bin/bash
# Reports the CGEventTap chain and flags leaks.
#
# WindowServer walks every registered tap on every input event -- including
# disabled ones -- so a process that leaks taps degrades the entire input path.
# Symptoms: unstable FPS, and three-finger Space swipes becoming very laggy
# (highest event rate = worst case).
#
# Healthy: ~10 taps total, 1-3 per process.
# Seen in the wild: Karabiner-Core-Service leaked 1029 taps over 14 days uptime.
@shirohana
shirohana / CHANGELOG.md
Last active August 29, 2026 06:17
Hana's Claude Setup

Changelog

Migration notes per revision, newest first. Each entry tells an agent on another machine exactly what to do to catch up.

2026-08-29 — superset + Scope section, rules tightened (home-laptop)

CLAUDE.md is now the SUPERSET for every machine, with a # Scope section at the end listing what each machine omits. A machine's copy = this file minus its omitted rules minus the Scope section. Current scope: home omits

@shirohana
shirohana / ~hooks-use-navigate-lock.js
Last active February 15, 2020 09:03
React Navigation Lock Example
// @flow
import { useCallback, useState } from 'react'
import { useFocusEffect } from '@react-navigation/native'
export default function useNavigateLock () {
const [isLocked, setIsLocked] = useState(false)
useFocusEffect(useCallback(() => {
setIsLocked(false)
}, []))
@shirohana
shirohana / ioslocaleidentifiers.csv
Last active March 7, 2019 05:23 — forked from suraphanL/ioslocaleidentifiers.csv
iOS Locale Identifiers
localeIdentifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@shirohana
shirohana / ioscountrycodes.csv
Last active March 7, 2019 04:33 — forked from jacobbubu/ISOCountryCodes.csv
iOS Country Codes
CountryCode Description
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua and Barbuda
AI Anguilla
AL Albania
AM Armenia
AN Netherlands Antilles
AO Angola
@shirohana
shirohana / Makefile
Created December 10, 2018 07:03
zx
.PHONY = inc
COUNTER_FILE = COUNTER
SOURCE_COUNTER = if [[ ! -e $(COUNTER_FILE) ]]; then touch $(COUNTER_FILE); fi; set -a; source $(COUNTER_FILE);
inc:
@$(SOURCE_COUNTER) \
echo $$COUNTER; \
echo 'export COUNTER='$$((COUNTER + 1)) > $(COUNTER_FILE)
@shirohana
shirohana / test.js
Created October 27, 2017 12:43
[Javascript] Traps when destructuring with getter
/**
* According to the example, we can know that Object-Destructuring
* has a left-to-right order (doesn't checked is it related to
* transpiler or is standard).
*/
class Test {
get prop1 () {
this._prop2 = 'prop2'
return (this._prop1 = 'prop1')
@shirohana
shirohana / .gitconfig
Last active November 5, 2017 10:05
Hana's git config
[alias]
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lga = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
range = show --oneline --quiet
tracked = ls-files --stage
untracked = ls-files --exclude-standard --others
ignored = ls-files --ignored --exclude-standard --others
conflicts = diff --name-only --diff-filter=U
@shirohana
shirohana / yarn-drop-cache.sh
Last active April 5, 2017 18:27
Simple shell script to drop the specified yarn cache
#!/bin/bash
REMOVE_DIRS=$(ls -d $(yarn cache dir)/* | grep $@)
if [ -z REMOVE_DIRS ]; then
echo Empty
else
for dir in $REMOVE_DIRS; do
read -p "rm -rf $dir? " -n 1 -r
echo # Present a newline
@shirohana
shirohana / git_config_alias.txt
Last active February 19, 2017 16:19
Hana's git aliases
[alias]
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lga = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
range = show --oneline --quiet
tracked = ls-files --stage
untracked = ls-files --exclude-standard --others
ignored = ls-files --ignored --exclude-standard --others