Skip to content

Instantly share code, notes, and snippets.

View azu's full-sized avatar

azu azu

View GitHub Profile
@azu
azu / README.md
Last active December 27, 2023 00:30
公式ドキュメントのユースケース

Ref なぜ僕は公式ドキュメントを読むのが苦手なのか #初心者 - Qiita

次のようなセクションがあった場合、何を読むかというのはその目的によって異なるという印象。

  • Getting Started: インストール、セットアップ
  • Tutorial: 基本的な使い方(代表的な使い方)
  • Concepts: デザインのコンセプト、なぜ作ったか
  • Examples: 動くサンプル
  • API Reference: APIのリファレンス
@azu
azu / docker failed to register layer: rename.md
Last active November 6, 2024 15:15
Notes on `failed to register layer: rename` error with docker pull.

📝 Docker's "failed to register layer" error on macOS/OrbStack.

Error Message

failed to register layer: rename /var/lib/docker/image/overlay2/layerdb/tmp/write-set-xxx /var/lib/docker/image/overlay2/layerdb/sha256 /<sha>: file exists

Reason

@azu
azu / post-commit
Last active October 14, 2023 07:16
Gitメモ: メモをコミットして作業ツリー自体はメモを書く直前に戻すcommit -hook
# 📝 [Note] Mode -- if commit message starts with "📝" or includes "[Note]"
IS_NOTE_MODE=$(git log -1 --pretty=%B | grep -E '^(📝|\[Note\])')
if [[ -n "${IS_NOTE_MODE}" ]]; then
# メモの作業内容を戻すコミットをする
headSHA=$(git rev-parse HEAD)
git revert --no-commit HEAD
git ls-tree -r --name-only HEAD | xargs git commit -m "↩️ ${headSHA}" --
# メモを書く直前の状態に作業内容を戻す
git revert --no-commit HEAD
# terminal notification
@azu
azu / sql-execute-os-command.md
Last active October 7, 2023 00:42
各SQLサーバでOSコマンドを実行する方法
@azu
azu / Bluesky: auto refresh.user.js
Last active August 21, 2025 12:01
Bluesky: auto refresh
// ==UserScript==
// @name Bluesky: auto refresh
// @namespace https://efcl.info
// @match https://bsky.app/*
// @grant none
// @version 1.0
// @author azu
// @description Auto Refresh when notifications is shown
// ==/UserScript==
const origSetInterval = window.setInterval;
@azu
azu / git auto commit.zsh
Created July 7, 2023 04:49
git auto commit
function git-auto-commit(){
git_status=$(git status --porcelain | grep -vE '^\s')
first=$(echo "$git_status" | head -n1)
filename=$(echo "$first" | awk '{print $NF}')
git_root_dir=$(git rev-parse --show-toplevel)
if echo "$first" | grep -Eq '^\s?M'; then
commit_message="Update $filename"
elif echo "$first" | grep -Eq '^\s?A'; then
commit_message="Add $filename"
elif echo "$first" | grep -Eq '^\s?D'; then
@azu
azu / get-new-ribbon.sh
Created May 28, 2023 01:21
Replace old GitHub ribbon image to new GitHub ribbon image. Old GitHub ribbon image is deleted at 2023-05
rg "https://s3.amazonaws.com/github/ribbons/" --files-with-matches -0 | xargs -0 sed -i '' 's/https:\/\/s3.amazonaws.com\/github\/ribbons\//https:\/\/github.blog\/wp-content\/uploads\/2008\/12\//g'
@azu
azu / README.md
Last active March 24, 2023 13:16
Alternative ni written in Zsh
@azu
azu / gh-issue-checkout.zsh
Created January 20, 2023 11:35
search GitHub Isssue and checkout for develop
function gh-issue-checkout(){
INITIAL_QUERY="$1"
GH_ISSUE_LIST="gh issue list -S"
FZF_DEFAULT_COMMAND="$GH_ISSUE_LIST '$INITIAL_QUERY'" \
gh issue list | \
fzf --layout=reverse \
--bind "change:reload:$GH_ISSUE_LIST {q} || true,ctrl-o:execute(echo {} | xargs gh issue view --web)+abort"\
--preview "gh issue view {1} | bat --color=always --style=grid --file-name O.md" \
--header 'Press Ctrl+O to open issue' \
| awk '{print $1}' | xargs -IXXX gh issue develop XXX --name "feature/XXX" --checkout