Skip to content

Instantly share code, notes, and snippets.

Avatar

Julien Reichardt j8r

  • Earth
View GitHub Profile
@j8r
j8r / youtube-dl.txt
Last active Feb 13, 2022
youtube-dl mp3 music download
View youtube-dl.txt
# 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
class String
struct Chars
include Indexable(Char)
def initialize(@str : String)
end
def unsafe_fetch(index)
@str.char_at(index)
end
@j8r
j8r / compile-crystal-arm64.sh
Last active Feb 11, 2021
Compile a Crystal program to a statically linked arm64 binary
View compile-crystal-arm64.sh
#!/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 \