cheatsheet command

This commit is contained in:
Night Kaly 2024-01-18 18:45:36 +00:00
parent 861a697e0f
commit ba690803c0
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE

13
.local/bin/misc/chtsh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
languages=$(echo "react nextjs javascript python java golang c cpp typescript rust" | tr " " "\n")
core_utils=$(echo "find xargs sed awk" | tr " " "\n")
selected=$(echo -e "$languages\n$core_utils" | fzf)
read -p "What you want to learn: " query
if echo "$languages" | grep -qs $selected; then
curl cht.sh/$selected/$(echo "$query" | tr " " "+")
else
curl cht.sh/$selected~$query
fi