Wednesday, June 21, 2023

med-sched-grid and the old one page wonder
I revamped an old tool I made for making printable charts for tracking our dear cat Dean's rather extensive set of medications and feeding schedule. 

It started as a test of Preact, but then I decided to code it as an exercise in vanilla.js while still using declarative programming. (It's sort of weird that "Preact is 3Kb!"'s app builder pulls down about 350 Mb of libraries for its dev environment...) Actually, I decided to indulge my fondness of "one page, no library, zero external files" style - even the images I use as icons are embedded SVG.

It uses local storage so that it will repopulate if you use the same browser, as well as offering permalinks you save and come back to.

Probably the fanciest aspect is the ability to jump forward or back a schedule's worth of time while updating the "offsets" - so for the cat's pill on a 2 week schedule, it automatically compensates and moves it up or back to the appropriate places on the chart when it's time to print the next one. (I came up with a clunky algorithm for that, since going back in time is a little weird to figure out. I then had ChatGPT spit out a more elegant version - but it started having regressions as I tried to get it iron out some edge cases, and so I went back with my handmade algorithm. It does make me wonder how much of the rest of my career will be test engineer for LLMs.)

No comments:

Post a Comment