private » Programming Hacks Used In This Site
Algorithms & Old Lace: LLM Poisoning For Personal Websites

Rage Against The Machine: Algorithms & Old Lace: LLM Poisoning For Personal Websites

Private AIs: They're Watching You

Last year my friends in an Indieweb meetup began to notice that information about them was turning up in LLMs... some comically inaccurate, some uncannily personal. As a group of personal website developers, we knew that much of the information must've been scraped of our website.

It might not be apparent reading my site, but I've always been a little careful about what information I allow about myself on the web. It's near impossible to prevent personal information from leaking out, and my name is unique enough that I'm not hard to find. I had an unfortunate incident with an online stalker a number years ago and since then have always been careful. I also once had a real-life harasser who broke into my home, although that was a much different and more complex situation. But together these made me aware that…

Code & Algorithms » Web
A Technological Solution to Disincentivize a Web Development “Concern Troll”

Fun With A Purpose: A Technological Solution to Disincentivize a Web Development “Concern Troll”

I had an interesting thing happen a few months ago where a troll in a chat room decided for some reason to run my site through the W3C's Nu HTML Validator and apparently was grievously wounded by the validation errors it had—and furthermore, had a big concern with the overall bandwidth consumption of the site, with all its images and heavy pages.

Rather than simply solving the problem by not visiting my site, this person apparently felt some sort of imperative to berate me over these things and not. let. it. drop, making the chat room difficult to be in and necessitating action on my part.

So, rather than try to verbally wrangle with a troll, I whipped up a technological solution. And, of course, the monkey in my soul decided to have a little fun with it.

I. Lassoing the HTML Validator

Nowadays, if…

Workshop » Works In Progress » Code & Algo Works In Progress
Draggable Elements WordPress Plugin

Nothin' But A Drag: Draggable Elements WordPress Plugin

First, the demo

This is a brief demo page for my KupieTools Draggable Elements WordPress plugin, which dynamically adds interactive draggability to any page element, based on CSS class names (or, really, any CSS selector).

Here's some boxes:

Drag Me Horizontally Drag Me Vertically Drag Me Anywhere Drag Me To Corners

If you select "View Page Source" on this page in your browser, you will see that the above four DIV elements, as defined in the page HTML, are just ordinary DIV elements with a single classname, an ID, and some visual styling. The KupieTools Draggable Elements plugin adds draggability to any arbitrary page element, by simply specifying a class name or other CSS selector for it in the plugin. (If you use your browser's Inspector instead of View Page Source, you'll see the current state of those elements, with any changes or additions the plugin created…

Workshop » Works In Progress » Code & Algo Works In Progress

Customization Is King: KupieTools Custom WordPress Plugins Overview

Pardon My Placeholder!

This page is a placeholder listing my various Github repos containing my custom WordPress plugin work, loosely branded as "KupieTools", as I work on more detailed pages documenting them.

kupietools/ktwp-wp-plugin-caching-toolkit A plugin providing functions for WordPress developers to implement PHP function caching for performance. kupietools/ktwp-wp-plugin-cli-mode WordPress plugin supplementing my CLI.html text-based web browsing front end. Adds a little icon on wordpress pages to allow users to switch to a javascript-based terminal emulator providing web page browsing commands via the keyboard. kupietools/ktwp-wp-plugin-debuggery-toolkit WordPress plugin providing handy debugging functions particular to the author's needs. /kupietools/ktwp-wp-plugin-draggable-elements WordPress Plugins allowing developers to make any previously existing page element draggable freely, vertically, horzontally, or constrained to corners, by adding the element's CSS selector to the plugin code. kupietools/ktwp-wp-plugin-editor-codefolding WordPress plugin adding code folding (disclosure triangles) to the built-in editors on WP's admin…
private » Programming Hacks Used In This Site
Easily embed this site’s content on other sites

For users: Easily embed this site’s content on other sites

This site allows you to get the content of posts and pages by adding either /embed/ or ?embed to the URL, optionally including the post title, author, and/or tags.

This was inspired by a discussion in an Indieweb Homebrew Website Club Europe/London online meetup. I want to say shadowy web standards advocate Tantek Çelik brought it up, so, as these things tend to happen, I coded it up here while we were talking. It's discussed on Indieweb's wiki at https://indieweb.org/embed.

What do you mean, 'Embed'?

Well, for instance, this post's permalink is https://michaelkupietz.com/?p=10887. You can see just the text of this post's content, without the sidebar and menus and other web page "furniture", at https://michaelkupietz.com/embed/?p=10887 or https://michaelkupietz.com/embed/?p=10887&embed, so you can theoretically include this page's content on your own site (long as you…

private » Programming Hacks Used In This Site
Non-render-blocking YouTube embeds in WordPress

Video Killed The Pagespeed Score: Non-render-blocking YouTube embeds in WordPress

On this site's Music Reviews page (itself built on-the-fly by a shortcode that sorts and displays posts from a "Music Review" custom post type), most of the reviews are accompanied by YouTube video embeds from the album in question.

What I didn't realize in setting that up is that YouTube embeds use [code][/code] tags to embed videos, and [code][/code] tags block page rendering—the page's onload property, which signals that the page is fully ready to display to the viewer and to remove the spinning "page loader" image I use on this site as pages load—does not fire until every iframe on the page has fully loaded its contents. This caused that page, which currently only has a handful of videos on it, to load very slowly. What's worse, this site's custom menus parse all page contents every time the site is updated to display for word counts,…

private » Programming Hacks Used In This Site
WordPress Shortcode & Function Performance Optimization with Transients

Optimization-A-Go-Go: WordPress Shortcode & Function Performance Optimization with Transients

I suffer from that paradoxical form of laziness peculiar to computer geeks where I will save myself save myself 15 minutes of work on something by spending 4 hours creating a shortcut. As such, the menus on this site are dynamically generated by traversing the category tree in PHP and laying out menus and submenus from categories and subcategories, sparing me the trouble of updating them manually as I add new content. This took some effort.

I created a shortcode that does this (well, modified a shortcode, originally from the Hierarchical HTML Sitemap plugin, by Alexandra Vovk & WP Puzzle) and soon my site was happily generating dynamic menus on the fly and keeping up with my work as I added pages, edited titles, and rearranged categories.

And, along the way, getting slower.

And slower. And slower.

Finally the other night, due to a confluence of circumstance,…

private » Programming Hacks Used In This Site
WordPress Custom “Hero Header” Modifications

Used on this site: WordPress Custom “Hero Header” Modifications

This site uses the "Sinatra" free Wordpress theme as its base. Sinatra includes a single "Hero Header" the row of 3 animated featured posts on the home page which changes background images as you mouse over post titles within it.

I wanted this to be multi-row, a grid instead of just one row. The code natively contained an option to include up to 12 featured posts, which could easily be made to wrap around to new rows, but the problem was, the background of the entire section containing all rows changed when you moused over a post, not just the single row, and I wanted not just a row-by-row background, but I wanted potentially unlimited rows.

I moved the code that generates the rows into a function, and then called it repeatedly, once for each row I want. At some point I may make it automatically add as many rows…

Code & Algorithms » WordPress Plugins & Mods
Generating On-The-Fly Email Addresses as an Anti-Spam Measure in WordPress

Generating On-The-Fly Email Addresses as an Anti-Spam Measure in WordPress

On my IT consulting business site, I'm using a php script I've written to generate on-the-fly random email addresses specific to the browsing session looking at the site. So, I can include email addresses in plain text on the site, but if a spammer harvests one, I can block it, and other people legitimately browsing the site will still get individualized working addresses they can contact me with.

It generates a log as email are generated, so you know who got what email. You'll want to watch the log size yourself so you don't fill your disk space.

Obviously it's more complicated than just this, there's whitelisting involved as well as some other behind-the-scenes trickery, such as double-checking emails against the log as they arrive, that I can't reveal publicly for opsec reasons.

But, I can reveal the basic php script that coughs up a random email address specific…