Blog

More than you expected?

You're reading everything on my blog - including, among other things:

  • notes (short, "Tweet-like" messages),
  • reposts (links to other people's work, sometimes with commentary),
  • checkins (records of places I've visited, often while geo*ing), and
  • videos ("vloggy" content).

That might be more than you wanted to see, if you're only interested in articles (traditional long-form blog posts). Click a link to filter.

Queer Coded 🌈

Paraphrased from a conversation in a Manchester pub last night –

Them: Your [dyed blue] hair is queer-coded, right? Like… you’re telegraphing you’re queer?
Me: I mean… I’m also wearing a pride rainbow t-shirt and my watch strap is a ‘bi pride’ flag. I don’t feel like I’m being subtle.
Them: Nah. The hair’s the giveaway.

Dan shrugs for the camera as he sits at a pub table with a variety of people; one woman, sat to his left, throws a V-sign with her fingers.

×

Dan Q found GC2MTTV Power to the People

This checkin to GC2MTTV Power to the People reflects a geocaching.com log entry. See more of Dan's cache logs.

Not too busy here this morning so I was able to mount a proper search for the cache. No sign of the container, so providing a photo log in accordance with CO’s instructions. TFTC.

Dan stretches high to touch the back of a sign mounted on a pole, alongside tram signals, in a city centre.

My GPSr puts the hint item about 9m South of the posted coordinates, with strong signal, BTW.

×

Dan Q found GC84F1A Manchester Central Library

This checkin to GC84F1A Manchester Central Library reflects a geocaching.com log entry. See more of Dan's cache logs.

What a truly spectacular cache. FP awarded, without hesitation. I’ve seen a similar kind in a library before but never with such depth, such a story, so voluminous a container, nor – let’s be honest – so beautiful a building!

The Wolfson room was packed, presumably with people studying for their upcoming exams, but I found a seat there to work out the final location. Once there, I made my way up and found it without difficulty. No trouble with the numbers from me.

Sitting in a traditionally-decorated circular reading room, Dan writes in a notepad.

I’m going to try to tag one or two more Manchester caches before I catch my train home, but I can’t imagine any will hold a candle to this. TFTC!

×

👋 Farewell, NLA

Highlights of yesterday’s Goodbye Nightline Association party in Manchester:

👨‍💻 Responded to Three Rings user query in real time by implementing new Directory property while at the event (pictured)
🤝 Met a handful of Nightliners past and present; swapped war stories of fights with students unions, battles for funding, etc. (also got some insights into how they’re using various tech tools!)
✍️ Did hilariously awful job of drawing ‘Condom Man’, Aberystwyth Nightline’s mascot circa 2000
🤞 Possibly recruited a couple of new Three Rings volunteers

Dan gestures at his laptop in a quiet pub function room, on which he's writing some code. In the background, two women are having a conversation.

Low points:

😢 It’s a shame NLA’s dying, but I’m optimistic that Nightlines will survive

×

Dan Q found GC5C8N2 Church Micro 6331…Manchester – St Ann’s

This checkin to GC5C8N2 Church Micro 6331...Manchester - St Ann's reflects a geocaching.com log entry. See more of Dan's cache logs.

I’m in Manchester for the day for a social gathering related to a variety of the volunteering activities I’ve been involved with over the last, OMG-I’m-so-old, 26 years or so. After my train arrived I meandered via OK04B5 (nice to see the OC community alive and well here in Manchester!) to find myself some lunch, then dropped by this cache on my way to our event venue.

The location was spot on and I saw the cache rightaway, but needed to wait for a couple of Deliveroo drivers to finish chatting and leave before I could get to the container itself. Soon in hand, though. TFTC!

Under a shady tree and in front of a church, Dan throws a thumbs-up.

×

Dan Q found OK04B5 The Beacon of Hope

This checkin to OK04B5 The Beacon of Hope reflects an opencache.uk log entry. See more of Dan's cache logs.

I’m in Manchester for a volunteering-adjacent social event and, not often seeing OpenCaches pop up on my radar, visited this spot on my way from the station to the venue. So beautiful to see Manchester acknowledge its part in queer history, and a beautiful memorial to everybody who has died as a result of the AIDS pandemic. TFTC!

Dan, wearing a pride rainbow t-shirt, stands alongside a steel beacon in the corner of an urban park, under bright late-spring sunlight.

×

Three Rings ❤️ NLA

Oxford Station. Catching a train to Manchester for a get-together in memory of the Nightline Association, which will sadly be closing this year (although individual Nightlines will doubtless soldier on just as they did before the Association).

Carrying a big ol’ bag of Three Rings swag to give to basically anybody who expresses even the slightest interest. 😅

Three Rings has been supporting Nightlines since before the Nightline Association and nowadays underpins voluntary work by hundreds of other charities including helplines like Samaritans and Childline. Feeling sad that the Nightline Association is going away and looking for a new and rewarding way to volunteer? Come chat to me!

Dan, with blue hair and wearing a black t-shirt, stands on a sunny train platform holding aloft a medium-sized tote bag.

×

What If the EU Never Existed?

This is a repost promoting content originally published elsewhere. See more things Dan's reposted.

Video framegrab showing an alternate history map of Europe in mid-to-late 20th century. West Germany has formed an economic union with several neighbouring states, while France and Italy have elected Communist governments and are within the Soviet sphere of influence.

This video, which I saw on Nebula but which is also available on YouTube, explores a hypothetical alternate history in which the Schuman Plan/European Coal & Steel Community never happened, and the knock-on effects lead to no EU, a more fragmented Europe, and an ultimately more-fractured and more-complicated Europe of the late 20th/early 21st century.

Obviously it’s highly-speculative and you could easily come up with your own alternative alternative history! But the Twilight Struggle player in me as well as the alternate history lover (and, of course, European Union fan) especially loves the way this story is told.

It’s worth remembering that for the last half-millenium or more, the default state of Europe has been to be fighting one another: if not outright war then at least agressive economic and political rivals. Post-WWII gave Europe perhaps its longest ever period of relative peace, and that’s great enough that all of the other benefits of a harmonised and cooperative union are just icing on the cake.

EU Made Simple is a fantastic channel in general, and I’d recommend you give it a look. It ties news and history in with its creators outlook, but it’s always clear which bits are opinion and it’s delightfully bitesized. For Europeans-in-exile in this post-Brexit age, it’s hopeful and happy, and I like it.

Happy Europe Day, one and all.

Dynamic Filters in Pure CSS

While working on something else entirely1, I had a random thought:

Could the :checked and and :has pseudo-classes and the subsequent-sibling (~) selector be combined to perform interactive filtering without JavaScript?

Turns out, yes. Have a play with the filters on the side of this. You can either use:

  • “OR” mode, so you can show e.g. “all mammals and carnivores”, or
  • “AND” mode, so you can show e.g. “all mammals that are carnivores”.

Filter the animals!

(if it doesn’t work right where you are, e.g. in a feed reader, you can view it “standalone”)

  • Alpaca
  • Anteater
  • Bat
  • Beetle
  • Butterfly
  • Camel
  • Cat
  • Chameleon
  • Cobra
  • Cow
  • Crab
  • Crocodile
  • Dog
  • Duck
  • Elephant
  • Elk
  • Fish
  • Frog
  • Giraffe
  • Hippo
  • Husky
  • Kangaroo
  • Lion
  • Macaw
  • Manatee
  • Monkey
  • Mouse
  • Octopus
  • Ostrich
  • Owl
  • Panda
  • Pelican
  • Penguin
  • Pig
  • Rabbit
  • Raccoon
  • Ray
  • Rhino
  • Rooster
  • Shark
  • Sheep
  • Sloth
  • Snake
  • Spider
  • Squirrel
  • Swan
  • Tiger
  • Toucan
  • Turtle
  • Whale

The source code is available to download under the Unlicense, but the animal images are CC-BY licensed (with thanks to Aslan Almukhambetov).

How does it work?

There’s nothing particularly complicated here, although a few of the selectors are a little verbose.

First, we set the initial state of each animal. In “OR” mode, they’re hidden, because each selected checkbox is additive. In “AND” mode, they’re shown, because checking a checkbox can only ever remove an animal from the result set:

#filters:has(#filter-or:checked) ~ #animals .animal {
  display: none;
}

#filters:has(#filter-and:checked) ~ #animals .animal {
  display: flex;
}

The magic of the :has pseudo-class is that it doesn’t change the scope, which means that after checking whether “AND” or “OR” is checked within the #filters, the #animals container is still an adjacent element.

Touchscreen interactive restaurant menu with filter categories on the left and dishes for selection in the centre.
Next time you’re implementing a filter interface, like this restaurant menu, perhaps ask whether you actually need JavaScript.

Then all we need to do is to use daisy-chain :has to show animals with a particular class if that class is checked in “OR” mode, or to hide animals that don’t have a particular class in “AND” mode. Here’s what that looks like:

#filters:has(#filter-or:checked):has(#aquatic:checked)  ~ #animals .aquatic,
#filters:has(#filter-or:checked):has(#bird:checked)     ~ #animals .bird,
...
#filters:has(#filter-or:checked):has(#reptile:checked)  ~ #animals .reptile {
  display: flex;
}

#filters:has(#filter-and:checked):has(#aquatic:checked) ~ #animals .animal:not(.aquatic),
#filters:has(#filter-and:checked):has(#bird:checked)    ~ #animals .animal:not(.bird),
...
#filters:has(#filter-and:checked):has(#reptile:checked) ~ #animals .animal:not(.reptile) {
  display: none;
}

It could probably enjoy an animation effect to make it clearer when items are added and removed2, but that’s a consideration for another day.

Many developers would be tempted to use JavaScript to implement the client-side version of a filter like this. And in some cases, that might be the right option.

But it’s always worth remembering that:

  • A CSS solution is almost-always more-performant than a JS one.
  • A JS solution is usually less-resilient than a CSS one: a CDN failure, unsupported API, troublesome content-blocker or syntax error will typically have a much larger impact on JavaScript.
  • For the absolutely maximum compatibility, consider what you can do in plain HTML, or on the server-side, and treat anything on the client-side as progressive enhancement.

Footnotes

1 The thing I was actually working on when I got distracted was an OAuth provider implementation for Three Rings, connected with work that took place at this weekend’s hackathon to (eventually) bring single-sign-on “across” Three Rings CIC’s products. Eventually being the operative word.

2 Such an animation should, of course, be wrapped in a @media (prefers-reduced-motion: no-preference) media query!

×
OSZAR »