Skip to content

Instantly share code, notes, and snippets.

View tom-flamelit's full-sized avatar
🎯
Focusing

Tom Roderick tom-flamelit

🎯
Focusing
View GitHub Profile
@tom-flamelit
tom-flamelit / radio.sh
Last active January 11, 2025 03:34
ZSH Functions for music streams
#!/bin/zsh
function listen_soma() {
local playlist=$1
local stations_url="https://api.somafm.com/channels.json"
local station_info=$(curl -s "$stations_url" | jq -r --arg station "$playlist" '.channels[] | select(.id == $station)')
if [[ -n "$station_info" ]]; then
local pls_url=$(echo "$station_info" | jq -r '.playlists[] | select(.format == "mp3" and .quality == "highest") | .url')
@tom-flamelit
tom-flamelit / pv.bash
Created February 4, 2023 18:23
Bash function `pv` to launch my common virtual environments
function pv { source "$HOME"/work/venv/"$1"/bin/activate; echo "$1 activated"; }
# To work for your setup: first have a common venv directory, then adapt the above to run
# To run, you type into shell `$ pv my_cool_venv_name`