Skip to content

Instantly share code, notes, and snippets.

View babarot's full-sized avatar
🇯🇵
Wa

Masaki ISHIYAMA babarot

🇯🇵
Wa
View GitHub Profile

import --into 設計(改訂版 v3)

コンセプト

import が「GitHub → stdout(新規YAML生成)」なのに対し、import --into は「GitHub → ローカルマニフェスト(既存YAML更新)」。apply の逆方向。

gh infra import owner/repo --into=./repos/manifest.yaml  # 特定ファイル
gh infra import owner/repo --into=./repos/               # ディレクトリ検索
@babarot
babarot / gh-infra-coverage.json
Last active April 19, 2026 17:06
Coverage badge for gh-infra
{"label":"coverage","message":"69.6%","schemaVersion":1,"color":"hsl(83, 100%, 40%)"}
{"label":"coverage","message":"44.2%","schemaVersion":1,"color":"hsl(53, 100%, 40%)"}
@babarot
babarot / oksskolten-client-coverage.json
Last active April 10, 2026 00:18
oksskolten coverage badges
{"label":"client coverage","message":"70.79%","schemaVersion":1,"color":"hsl(84, 100%, 40%)"}
@babarot
babarot / enter-coverage.json
Last active April 14, 2026 23:22
Coverage badge for babarot/enter
{"label":"coverage","message":"74.8%","schemaVersion":1,"color":"hsl(89, 100%, 40%)"}
@babarot
babarot / convert_arw_to_jpg.sh
Created July 27, 2024 09:00
Convert Sony RAW to JPEG data
dir="${1:-.}"
cnt=1
done=0
files=()
for file in ${dir}/*
do
case ${file##*.} in
"ARW" | "arw")
true
@babarot
babarot / parallel_wait.sh
Last active July 27, 2024 08:14
Wait for a fix number of process in bash
for i in {1..10}
do
{
c=$((RANDOM % 6 + 1))
echo "start $c"
sleep $c
echo "end $c"
} &
if (( (i % 5) == 0 )); then
wait
package main
import (
"errors"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
)
func main() {
Output afx.gif
# Set Theme "Builtin Solarized Dark"
Set FontSize 55
Set Width 2400
Set Height 800
Type "afx install"
Enter
@babarot
babarot / gocover.sh
Created February 16, 2023 01:28
Get go test coverage and open it in browser
#!/bin/bash
out=/tmp/cover.out
html=/tmp/cover.html
go test -cover ./... -coverprofile=$out
go tool cover -html=$out -o $html
open $html
sleep 1
rm $out $html