View youtube-dl.txt
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
# python3 -m pip install --user --upgrade youtube-dl | |
# ~/.local/bin should be in the PATH in ~/.bashrc / ~/.zshrc (PATH=$PATH:~/.local/bin) | |
# now at ~/.local/bin/youtube-dl | |
youtube-dl -o "%(title)s.%(ext)s" -f bestaudio --embed-thumbnail --extract-audio --audio-quality 0 --audio-format mp3 $URL | |
# yt-dlp | |
# python3 -m pip install --user --upgrade yt-dlp | |
yt-dlp -o "%(title)s.%(ext)s" --embed-thumbnail --extract-audio --audio-quality 0 --audio-format opus $URL |
View string_with_chars.cr
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
class String | |
struct Chars | |
include Indexable(Char) | |
def initialize(@str : String) | |
end | |
def unsafe_fetch(index) | |
@str.char_at(index) | |
end |
View compile-crystal-arm64.sh
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/sh -eu | |
LOCAL_PROJECT_PATH=${1-$PWD} | |
BUILD_COMMAND=" | |
shards build --static --release | |
chown 1000:1000 -R bin | |
" | |
INSTALL_CRYSTAL=" | |
echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >>/etc/apk/repositories | |
apk add --update --no-cache --force-overwrite \ |