Skip to content

Instantly share code, notes, and snippets.

View babarot's full-sized avatar
🇯🇵
Wa

Masaki ISHIYAMA babarot

🇯🇵
Wa
View GitHub Profile
@babarot
babarot / gh-infra-coverage.json
Last active March 21, 2026 15:09
Coverage badge for gh-infra
{"label":"coverage","message":"74.8%","schemaVersion":1,"color":"hsl(89, 100%, 40%)"}
{"label":"coverage","message":"50.0%","schemaVersion":1,"color":"hsl(60, 100%, 40%)"}
@babarot
babarot / oksskolten-client-coverage.json
Last active March 20, 2026 14:40
oksskolten coverage badges
{"label":"client coverage","message":"70.84%","schemaVersion":1,"color":"hsl(85, 100%, 40%)"}
@babarot
babarot / enter-coverage.json
Last active March 19, 2026 18:38
Coverage badge for babarot/enter
{"label":"coverage","message":"74.9%","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
@babarot
babarot / tmuxx.sh
Created March 11, 2022 15:18
tmux executor
#!/bin/bash
# is_login_shell returns true if current shell is first shell
is_login_shell() {
[[ $SHLVL == 1 ]]
}
# is_git_repo returns true if cwd is in git repository
is_git_repo() {
git rev-parse --is-inside-work-tree &>/dev/null