Skip to content

Instantly share code, notes, and snippets.

View ianrenton's full-sized avatar

Ian Renton ianrenton

View GitHub Profile
@ianrenton
ianrenton / gist:9ede79e9f6b196a423a0530dafe66538
Last active April 13, 2025 16:59
Arbitrary precision Maidenhead grid to lat/lon conversion in JavaScript
// Convert a Maidenhead grid reference of arbitrary previcision to lat/long.
function latLonForGrid(grid) {
// Make sure we are in upper case so our maths works. Case is arbitrary for Maidenhead references
grid = grid.toUpperCase();
// Return null if our Maidenhead string is invalid or too short
let len = grid.length;
if (len <= 0 || (len % 2) !== 0) {
return null;
}
@ianrenton
ianrenton / all-2024-activators.py
Created March 16, 2025 07:10
List all Parks on the Air (POTA) activators in the UK in 2024
from requests_cache import CachedSession
from datetime import timedelta
from time import sleep
# List of UK-adjacent programs
programs = ["GB", "IM", "GG", "JE", "GI", "FK"]
call_prefixes = ["G", "M", "2"]
year = 2024
# Setup
@ianrenton
ianrenton / fedi-mutuals-websites.py
Last active January 25, 2025 15:56
Script to find your fedi mutuals' websites
# Script to find your fedi mutuals' websites.
# In the spirit of nerd fedi's desire to bring back self-owned websites, blogs and RSS feeds, this scripts finds all
# your fedi mutuals, and grabs the URLs from their custom fields. By default it only returns "verified" ones on the
# assumption that these are probably personal sites not other randomly-linked things, but you can turn that off if you
# like. Definitely works on Mastodon, not tested on anything else, sorry.
# Ian Renton, January 2025
# Public Domain software
import re
import requests
@ianrenton
ianrenton / fedi-mutuals-callsigns.py
Last active January 3, 2025 20:47
Scrape callsigns of ham radio folks from your fedi mutuals
# Find callsigns of all the ham radio folks you are mutuals with on fedi (may only work with Mastodon)
# and produce a list so you can add them to HamAlert or something.
# Ian Renton, January 2025
# Public Domain software
import re
import requests
USERNAME='ian'
INSTANCE='https://mastodon.radio'

Keybase proof

I hereby claim:

  • I am ianrenton on github.
  • I am ianrenton (https://keybase.io/ianrenton) on keybase.
  • I have a public key whose fingerprint is D732 954A 1EFD CB26 BB00 87BE 40F6 0729 F8CC 2EF5

To claim this, I am signing this object: