Awesome List of minis implementations
Detail: https://kdb.tsukuba.ac.jp/syllabi/2022/GB27001/jpn/0
problemNum | shellgei | |
---|---|---|
00000001 | echo test | |
00000002 | echo $(<input.txt) | |
00000003 | seq 10 | |
00000004 | awk '{a=0;for(i=1;i<=NF;){a+=$(i++)}print a}' input.txt | |
00000005 | j=1;for i in {0..10};do echo ${f:-0};((k=f+j,f=j,j=k));done | |
00000006 | bc -l<<<'4*a(1)'|cut -b-12 | |
00000007 | bc -l<<<'scale=999;4*a(1)'|tr -d '\\\\\n'|cut -b-102 | |
00000008 | awk '{print x=$1-(y=$2/2-$1),y}' input.txt | |
00000009 | sed -zr 's/([^\n])\n([^\n])/\1@\2/g' input.txt|sort -rV|while read i;do [ -n "$i" ]&&echo $i$'\n'|tr @ \\n;done|sed \$d |
#!/usr/bin/env bash | |
if ! command -v mecab nkf &>/dev/null | |
then | |
echo "install: mecab nkf" >&1 | |
exit 1 | |
fi | |
read -r input |
Detail: https://kdb.tsukuba.ac.jp/syllabi/2022/GB27001/jpn/0
#!/usr/bin/env bash | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
curl -sSL https://install.python-poetry.org | python3 - | |
poetry completions zsh > ~/.zfunc/_poetry | |
brew tap homebrew/cask-fonts | |
brew install alacritty byobu pyenv starship nano font-hack-nerd-font | |
cat <<'A'>~/.zshrc |
*.nanorc
-hosting repositoriesCreated: 2022-12-12
sequenceDiagram
autonumber
actor 男女
participant suzume as スズメ
participant kounotori as コウノトリ
男女->>男女: セックス
suzume->>男女: セックス確認
suzume->>kounotori: 連絡
kounotori->>kounotori: セックス
#!/usr/bin/env bash | |
if ! command -v awk git grep sed wget &> /dev/null; then | |
echo "install: awk, git, grep, sed, wget" | |
exit 1 | |
fi | |
[ -f joyo2010.txt ] || wget https://raw.githubusercontent.com/cjkvi/cjkvi-tables/master/joyo2010.txt | |
[ -f ucs-strokes.txt ] || wget https://raw.githubusercontent.com/cjkvi/cjkvi-ids/master/ucs-strokes.txt |
# 一行だけのコメントは `#` から始まります。 | |
#[ | |
これは複数行のコメントです。 | |
Nimでは、複数行のコメントはネスト可能で、#[ に始まり | |
... ]# に終わります。 | |
]# | |
discard """ | |
これでも複数行のコメントとして機能します。 |
⢀⣀⣀⣀⣈⣿⣀⣀⠀⠀⠀⠀⠀⢀⣴⡿⠂⠀⠀⢶⠶⠶⢶⣶⠆ | |
⠈⠉⠉⣩⡿⣿⠉⠉⠀⢀⣠⣤⡾⣿⠁⠀⠀⠀⠀⠀⠀⢀⣾⠏ | |
⢀⣠⣾⠛⠀⣿⠀⠀⠀⠘⠋⠁⠀⣿⠀⠀⠀⠀⠀⢀⣴⡿⠻⢷⣄ | |
⠈⠋⠀⠀⠀⠿⠀⠀⠀⠀⠀⠀⠀⠿⠀⠀⠀⠀⠸⠟⠁⠀⠀⠈⠻⠃ | |
⣀⡤⠴⠔⠒⠚⠚⠚⠚⠚⠚⠒⠴⢄⡀ | |
⢀⡴⠊⠁ ⠀⠀⠀⠀⠀⠀⠀⣀⣀ ⡀⠙⢦⡀ | |
⣠⠋⠀ ⠀⠀ ⠀⠀⠀⠀⠀⣠⠞⠁⠁⠉⠙⢢⡀⠙⣄ | |
⢰⠃⣰⠚⠉⠉⠉⠓⢦⡀⠀⠀⢰⠃⠀⠀⠀⠀⠀⠀⢹⠀⠈⢆ | |
⢸⠀⡇⠀⠀⠀⠀⠀⠀⠙⣆⠀⠸⡄⠀⠀⠈⠀⠀⠀⠨⡇⠀⠘⣇⠀ | |
⠘⡆⡇⠀⠀⠀⠈⠀⠀⠀⢸⠀⠀⠙⠦⣀⣀⢀⣀⣀⣨⠃⠀⠀⠸⡄ |
#!/usr/bin/env bash | |
function dedent() { | |
local src min | |
src="$(expand -t 2 -)" # 1 tab = 2 spaces | |
if [ -z "$src" ]; then | |
echo "dedent: input is empty." >&2 | |
return 1 | |
fi | |
min="$( |