Skip to content

Instantly share code, notes, and snippets.

View ktnyt's full-sized avatar
💫

Mirei Itaya ktnyt

💫
View GitHub Profile

For git commits, write a single, emoji-prefixed, imperative commit subject. Keep the subject under ~60 characters, no trailing period. Prefer small, focused commits and human-friendly language. Use lowercase after the emoji.

Format:

  • Subject line only for simple changes: EMOJI short imperative summary
  • Optional body only when it adds necessary context (what/why, not how). Wrap body at ~72 chars. Avoid boilerplate.
  • Do not add scope tags like feat: or fix:; use the emoji as the category indicator.
  • Don’t end the subject with punctuation.
  • Prefer multiple atomic commits over one omnibus commit.

Emoji categories to choose from:

@ktnyt
ktnyt / coverage.md
Last active June 23, 2025 02:35
Python Test Coverage Checker Tool

$ARGUMENTS のカバレッジテンプレートを作成して境界値分析・テスト追加を実施しよう。

以下を TODO リストに追加:

  1. 記憶の再確認(~/config/claude/CLAUDE.md, ./**/CLAUDE.md, /mcp__memory__read_graph
  2. uv run python ./scripts/coverage_checker.py FILENAME を使ってカバレッジを確認
  3. カバレッジチェックリストが存在しない場合 uv run python ./scripts/coverage_checker.py FILENAME --generate-templates を使って生成
  4. チェックリストがなかった関数について境界値分析を実施
  5. テンプレートに従って境界値を記述
  6. テストを記述
@ktnyt
ktnyt / jsonrpc.py
Last active February 2, 2025 04:52
Just a simple asyncio standard I/O (stdio) based JSON RPC implementation.
import asyncio
import json
import logging
import os
import re
from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from typing import Any, TypedDict
@ktnyt
ktnyt / module_set.py
Created November 11, 2024 10:02
An override-able Module Set for the Python "Injector"
from __future__ import annotations
import contextlib
from typing import Callable, Generator, Type
from injector import Binder, Module
__all__ = ['ModuleSet']
import struct
import time
from math import atan2, degrees
import supervisor
import board
import digitalio
import busio
from usb_hid import Device
@ktnyt
ktnyt / FontAwesome-v5.0.9-Free.json
Last active October 14, 2023 09:40 — forked from sakalauskas/FontAwesome-v5.0.9-Free.json
List of all Font Awesome 5 icons in JSON Cheetsheet
[
"fas fa-address-book","fas fa-address-card","fas fa-adjust","fas fa-align-center","fas fa-align-justify","fas fa-align-left","fas fa-align-right","fas fa-allergies","fas fa-ambulance","fas fa-american-sign-language-interpreting","fas fa-anchor","fas fa-angle-double-down","fas fa-angle-double-left","fas fa-angle-double-right","fas fa-angle-double-up","fas fa-angle-down","fas fa-angle-left","fas fa-angle-right","fas fa-angle-up","fas fa-archive","fas fa-arrow-alt-circle-down","fas fa-arrow-alt-circle-left","fas fa-arrow-alt-circle-right","fas fa-arrow-alt-circle-up","fas fa-arrow-circle-down","fas fa-arrow-circle-left","fas fa-arrow-circle-right","fas fa-arrow-circle-up","fas fa-arrow-down","fas fa-arrow-left","fas fa-arrow-right","fas fa-arrow-up","fas fa-arrows-alt","fas fa-arrows-alt-h","fas fa-arrows-alt-v","fas fa-assistive-listening-systems","fas fa-asterisk","fas fa-at","fas fa-audio-description","fas fa-backward","fas fa-balance-scale","fas fa-ban","fas fa-band-aid","fas fa-barcode","fas fa-bars",
@ktnyt
ktnyt / useThrottle.ts
Last active November 30, 2022 11:18
useThrottle hook like thing in Solid.js
import {
Accessor,
createEffect,
createSignal,
onCleanup,
untrack,
} from 'solid-js'
export const useThrottle = <T>(
source: Accessor<T>,
@ktnyt
ktnyt / diff.go
Created July 2, 2021 02:40
A naive implementation for computing the diff of two strings with zero external dependencies.
package diff
import (
"fmt"
"strings"
)
func max(i, j int) int {
if j > i {
return j
@ktnyt
ktnyt / README.md
Created January 13, 2021 14:00
Sass color mixing for TypeScript.

Sass color mixing for TypeScript.

A literal clone of the mixcolor function provided in libsass in TypeScript. Calling the mix function will do the mixing as well as color hex value sanity checking among other things.

@ktnyt
ktnyt / brew-install.sh
Last active February 2, 2021 08:16
As easy as it sounds.
#/bin/sh
brew install \
go goreleaser \
coreutils gnu-sed \
git tig \
the_silver_searcher \
tmux htop wget \
pv jq yq tag \
autoconf automake \
n [email protected] \