Lessons:

1. Remember to write tests

2. Tests will lie to you if you're not careful

3. Code can look correct yet still be silently wrong

4. Silently-wrong code can be live for months or years with no one noticing

5. Computers were a mistake. I need a sailboat and a long break from everything.

Show thread

Peak "how did this ever work" today in PHP land. I was debugging a method that was improperly returning an empty array. Dig into the code ... and found that it was hard-coded to do so.

But oh! Polymorphism meant a subclass had a non-empty-returning implementation.

Yet that was still improperly returning an empty array.

Ultimately, the very innermost method was returning an array with the wrong schema, which caused subsequent lookups to be blank.

A one-line fix got it working.

Answer: array_udiff() plus the spaceship operator.

Show thread
kboyd boosted

While digging through this obvious scam, I did manage to learn that OSM already has this. It's called "KartaView" (though as one point also had the more reasonable sounding name "OpenStreetView") wiki.openstreetmap.org/wiki/Ka

Support OpenStreetMaps, do not support those sketch AF looking clowns with a crypto-mining-dash-cam.

Show thread

Apparently array_diff doesn't like to compare arrays of arrays. Hmm. Wonder what I should be using instead.

... and while the internal jax library might be able to support cpu-bound rendering using the 'iree' variant rather than the 'cuda' one, it's refusing to install jaxlib, so I can't even try that out ...

Show thread

Drat. Tried playing with Dall-E Mini in a local docker/colima instance, and found out that it doesn't support Apple Silicon.

Went on a bit of a domain purchasing spree yesterday, but in a wonderful twist on that old saw, I also actually built and shipped a webpage on one of them:

sailingcoops.com - a directory of cooperative and nonprofit sailing organizations.

No, I think I won't be adding that to my domain cart.

Soon, the birbsite will introduce Twitter Paper™️, a daily printed digest of the best tweets from the people you follow.

You can read your TP and then upcycle it at your leisure.

Just when I thought I was starting to understand the depths of weirdness to which the world can sink ...

wat.

Current status: Wondering if I'll have to ditch a database droplet on DigitalOcean and switch to a database cluster ... a 200% price increase - if it can even handle the same workload, otherwise I'd have to go to the larger cluster sizes (6x and 12x the current cost, respectively, for the larger sizes)

Hobby projects can get expensive, it seems.

Today I realized a few minutes too late that using the php array index of "wat" is a bad idea when my goal was to demo an approach to using getters.

kboyd boosted

I wrote up a blog post about some of the issues I encountered with my recent Wordpress project. Includes some tips on how to make a "members-only" area for a club or organization website.

whateverthing.com/blog/2022/05

Keep your friends close, and your WordPress installation closer.

kboyd boosted

Ooh, #WordPress 6.0 is out. Tons of new stuff for managing blocks and styles, lots of writing improvements like selecting multiple paragraphs of text and typing [ [ to get a list of recent posts and pages, you can lock blocks, more template options, and lots of accessibility improvements. Nom nom.

WordPress 6 announcement: wordpress.org/news/2022/05/art

WordPress 6 accessibility improvements: make.wordpress.org/core/2022/0

Just saw some code I wrote referenced in a diagram as a "thick proxy".

I have edit control of the diagram.

VERY tempted to change it to "thicc proxy".

Show older
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.