Skip to content

Instantly share code, notes, and snippets.

View sushichan044's full-sized avatar

Kentaro Suzuki sushichan044

View GitHub Profile
# Inspired by: https://github.com/elecdeer/dotfiles/blob/14604501ed14095f30ba9d0240b6dc0f50a6dc90/hanger/plugins/on-demand-completion/on-demand-completion.plugin.zsh
#
# usage: lazy_completion <command_name> [completion_command]
# Example:
# lazy_completion 'gh' 'gh completion -s zsh'
lazy_completion() {
local cmd_name=$1
local completion_command="$2"
local function_name="_${cmd_name}"
#!/usr/bin/env zsh
FETCH_INTERVAL_SECONDS=900 # 15 minutes
_should_fetch() {
# Do nothing if not inside a git repository
command git rev-parse --is-inside-work-tree &>/dev/null || return 1
local git_dir="$(realpath "$(git rev-parse --git-dir 2>/dev/null)")"
local last_fetch_file="${git_dir}/SUSHICHAN044_last_auto_fetch_time"
@sushichan044
sushichan044 / memo.zsh
Created September 8, 2025 14:23
my memo shortcut
#!/bin/sh
__ensure_memo_base_directory() {
local memo_dir="$(pwd)/.sushichan044/memo"
mkdir -p "$memo_dir"
echo "$memo_dir"
}
memo() {
local provided_name="$1"
#! /usr/bin/env node
// @ts-check
/**
* @fileoverview Send a macOS notification with the last message content from a Claude transcript.
*/
import { execFileSync } from "node:child_process";
import { readFileSync } from "node:fs";
import path from "node:path";
import os from "node:os";
@sushichan044
sushichan044 / node-ts.sh
Last active June 30, 2025 14:13
shorthand alias to execute your typescript with nodejs
#!/bin/sh
# execute typescript with node.js
nts() {
if ! type "node" >/dev/null 2>&1; then
echo "node is not installed"
return 1
fi
if ! type "npx" >/dev/null 2>&1; then
{
"theme": "Atom One",
"autoAccept": true,
"checkpointing": {
"enabled": true
},
"usageStatisticsEnabled": false
}
@sushichan044
sushichan044 / fzf-worktree.zsh
Last active June 5, 2025 15:24
Interactively select a git worktree within the current directory and its subdirectories using fzf, and then easily cd into it.
#!/bin/zsh
# fzf-based git worktree selector
# Inspired by:
# - https://www.mizdra.net/entry/2024/10/19/172323 (git branch selection patterns)
#
# Usage:
# - Direct: fzf-worktree
# - Keybind: Ctrl+N
#
# Features:
@sushichan044
sushichan044 / settings.yml
Created May 22, 2025 14:10
github-nippou settings
format:
subject: '### %{subject}'
line: '* [%{title}](%{url}) by @[%{user}](https://github.com/%{user}) %{status}'
dictionary:
status:
merged: '**merged!**'
closed: '**closed!**'