Applying highlight.js to inline code on WordPress

If you're using the plugin Prismatic to apply highlight.js to your code excerpts, but you want it to also affect inline <code> tags (i.e. those not wrapped in <pre> blocks), simply go Settings > Prismatic > Highlight.js and paste this monster into the “Init Script” field: // This init script was written by James E.…

Parsing the HTTP "Date" header in Python

As per RFC 7231 §7.1.1.1: A recipient that parses a timestamp value in an HTTP header field MUST accept all three HTTP-date formats. These formats are then described as (with the first being the only preferred format; the latter 2 are designated as "obsolete"), converted for this post into strftime(3) syntax: %a, %d %b %Y…

Basic JS Async Cookbook

// aXMLHttpRequest: an asynchronous XHR function function aXMLHttpRequest(method, location, responseType="", body=undefined) { // somewhat basic; improvements welcome return new Promise( (resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.open(method, location); xhr.responseType = responseType; xhr.onload = resolve; xhr.onerror = reject; xhr.send(body); return xhr; }); } // asleep: an asynchronous sleep function asleep = (delay =>…

Minecraft: switching from Forge to Fabric

The only amenities I needed were increased FPS, NBT Tooltips, Fancy-leaves-on-Fast-graphics, Zoom, and Saturation Display. These are provided on Fabric, respectively, by: Sodium NBT Tooltip Also Sodium (once they fix #233) Cull Leaves, for now WI Zoom AppleSkin I will update this post as I use more stuff. I will cross out, but not delete,…

Minecraft: Opening a Java sever to console and mobile clients

Due to the work of some brilliant people, it’s now possible to open a Minecraft Java Edition server to Bedrock Edition clients; and, due to another brilliant dude, it’s possible to connect even the nerfed console ports up to an arbitrary server. This means you can have simultaneous crossplay among the whole cornucopia of PC,…