Skip to content

Instantly share code, notes, and snippets.

@sentriz
sentriz / rain.fish
Last active July 19, 2023 22:20
precipitation from api.met.no with graph in shell
#!/usr/bin/env fish
set lat "53.350140"
set lon "-6.266155"
set url "https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=$lat;lon=$lon"
set point_per_mm 10
function parse
jq -r \
--argjson start (date -d (date -u +"%Y-%m-%dT%H:00:00Z") +%s) \
@sentriz
sentriz / lastfm-to-gonic
Last active May 27, 2023 22:20
last.fm favourites to gonic playlist
#!/usr/bin/env fish
if ! test (count $argv) -eq 2
echo 'usage: find /path/to/music -type f \( -name \'*.mp3\' -o -name \'*.flac\' \) | ./last-fm-to-gonic USER API_KEY >/gonic/playlists/<user>/lastfm.m3u' >&2
exit 1
end
set user $argv[1]
set api_key $argv[2]
set per_page 100
#!/usr/bin/env bash
URL="https:\/\/notes-extensions.$DOMAIN"
ORG='joe'
EXT_DIR='exts_data'
curl -s "https://api.github.com/orgs/sn-extensions/repos?page=1&per_page=100" \
| jq -r '.[].git_url' \
| grep -E '\/[a-z]+\-[^\/]*.git$' \
| xargs -L 1 git -C "$EXT_DIR" submodule add --depth 1
@sentriz
sentriz / box_meme.py
Last active July 14, 2020 17:45
box meme thing generator
#!/usr/bin/env python3
import sys
if not sys.argv[1:] or len(sys.argv[1]) < 5:
print('please provide a 5+ letter word', file=sys.stderr)
sys.exit(1)
word = sys.argv[1].upper()