Skip to content

Instantly share code, notes, and snippets.

View tamakiii's full-sized avatar

Daichi Tamaki tamakiii

  • undefined
  • Shibuya, Tokyo, Japan
  • X @tamakiii
View GitHub Profile
@tamakiii
tamakiii / README.md
Last active September 30, 2025 20:22
Working with credentials managed by Keychain Access in CLI on macOS

Export to Environment variable

export OPENAI_API_KEY="$(security find-generic-password -s OPENAI_API_KEY -a $(whoami) -w)"

Copy to clipboard

security find-generic-password -s OPENAI_API_KEY -a "$(whoami)" -w | pbcopy
@tamakiii
tamakiii / Makefile
Last active June 18, 2025 05:37
DuckDB-based tool for analyzing Claude Code conversations with MCP server integration.
.PHONY: help check setup teardown load @load duckdb show-tables desc count claude
PROJECTS := $(HOME)/.claude/projects
select-project = $(shell find "$(PROJECTS)" -mindepth 1 -maxdepth 1 -type d | fzf --select-1 --exit-0)
select-table = $(shell echo "$1" | sed -e 's/ /\n/g' | fzf --select-1 --exit-0)
get-table = $(shell echo "$(notdir $1)" | sed 's/[^a-zA-Z0-9]/_/g')
list-tables = $(shell duckdb database.duckdb -json "SHOW TABLES;" | jq -r '.[].name')
help:
@cat $(firstword $(MAKEFILE_LIST))
@tamakiii
tamakiii / README.md
Last active February 6, 2025 10:49
Use GNU commands on macOS

coreutils

The default installed commands, such as date, may not be compatible with general Linux systems.

$ date -d '+10 minutes' +%s
date: illegal option -- d
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
@tamakiii
tamakiii / README.md
Last active December 11, 2024 07:23
Markup diagram styles

(TBW)

@tamakiii
tamakiii / README.md
Last active November 4, 2024 02:10
Frequently used shell commands

git

# Get the current commit hash of HEAD (the latest commit on the current branch)
git rev-parse @

# Get the current branch name (using "@" as shorthand for "HEAD" or the current branch)
git rev-parse --abbrev-ref @

# Commit with the current branch name as the commit message (useful for quick commits labeled by branch name)
git commit -m "$(git rev-parse --abbrev-ref @)"
@tamakiii
tamakiii / REAME.md
Created November 1, 2024 08:57
GitHub Actions best practices

Set timeouts

Specify timeouts in GitHub Actions to prevent prolonged tasks

timeout-minutes: 5

Catch Bash Pipe Errors

Define the default shell as Bash in the workflow settings, enabling pipefail to detect errors during piping.

defaults:
@tamakiii
tamakiii / README.md
Created December 11, 2023 06:05
Variable and Environment Variable in GNU Make
$ cat Makefile
.PHONY: all

export AWS_PROFILE ?= acme
AWS_REGION ?= us-west-2

all:
        @echo AWS_PROFILE=$(origin AWS_PROFILE)
 @echo AWS_REGION=$(origin AWS_REGION)
@tamakiii
tamakiii / README.md
Last active December 11, 2023 05:52
GNU Make: export AWS_PROFILE with `:=`, `=` and `?=`

With export AWS_PROFILE :=

$ cat Makefile
.PHONY: test

export AWS_PROFILE := acme
export AWS_REGION := us-west-2

test:
        @echo "AWS_PROFILE=$(AWS_PROFILE) (origin: $(origin AWS_PROFILE))"
@tamakiii
tamakiii / script.sh
Last active November 2, 2023 15:52
[WIP] ECS register task definition script (update images with specific :tag)
#!/usr/bin/env bash
export VERBOSE=false
export DRYRUN=false
export HELP=false
export AWS_REGION=
export AWS_PROFILE=
export AWS_DEBUG=
# declare -x DESIRED_COUNT=false
@tamakiii
tamakiii / AndroidManifest.xml
Created October 21, 2023 08:07
com.oculus.browser_26.3.0.13.55.467458615-336800267_minAPI25(arm64-v8a)(nodpi)_apkmirror.com
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="33" android:compileSdkVersionCodename="13" package="com.oculus.browser" platformBuildVersionCode="33" platformBuildVersionName="13">
<uses-feature android:glEsVersion="0x00020000"/>
<uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission-sdk-23 android:maxSdkVersion="30" android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_ADVERTISE"/>