This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir="${1:-.}" | |
cnt=1 | |
done=0 | |
files=() | |
for file in ${dir}/* | |
do | |
case ${file##*.} in | |
"ARW" | "arw") | |
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..10} | |
do | |
{ | |
c=$((RANDOM % 6 + 1)) | |
echo "start $c" | |
sleep $c | |
echo "end $c" | |
} & | |
if (( (i % 5) == 0 )); then | |
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"github.com/jmoiron/sqlx" | |
_ "github.com/mattn/go-sqlite3" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Output afx.gif | |
# Set Theme "Builtin Solarized Dark" | |
Set FontSize 55 | |
Set Width 2400 | |
Set Height 800 | |
Type "afx install" | |
Enter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! type sd &>/dev/null; then | |
echo "sd: command not found" >&2 | |
exit 1 | |
fi | |
case "${#}" in | |
0) | |
echo "too few arguments" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! type jq &>/dev/null; then | |
echo "jq: not found" >&2 | |
exit 1 | |
fi | |
if ! type gcloud &>/dev/null; then | |
echo "gcloud: not found" >&2 | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for policy in $@ | |
do | |
if [[ $policy == *_test.rego ]]; then | |
continue | |
fi | |
if [[ $policy == *.rego ]]; then | |
file=${policy##*/} | |
mkdir -p .policy/rego/prc/"${file%*.rego}" | |
git mv $policy .policy/rego/prc/"${file%*.rego}"/src.rego |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"os" | |
"github.com/k0kubun/pp" | |
"github.com/moby/buildkit/frontend/dockerfile/instructions" | |
"github.com/moby/buildkit/frontend/dockerfile/parser" | |
) |
NewerOlder