Skip to content

Instantly share code, notes, and snippets.

View amcgregor's full-sized avatar
🏢
Examining Options

Alice Zoë Bevan–McGregor amcgregor

🏢
Examining Options
View GitHub Profile
@amcgregor
amcgregor / 1-#webcore.log
Last active June 7, 2021 22:09
Goodbye Freenode. It was a mostly-fun 15 years.
# "Official services" forced out of channel, usurper joins and gains control.
[2021-05-25T23:04:14-0400] ChanServ (ChanServ@services.) left the channel
[2021-05-25T23:04:17-0400] freenodecom (~com@freenode/staff) joined the channel
[2021-05-25T23:04:17-0400] freenodecom sets mode +o freenodecom
[2021-05-25T23:04:17-0400] freenodecom changed the topic to This channel has moved to ##webcore. The topic is in violation of freenode policy: https://freenode.net/policies
[2021-05-25T23:04:17-0400] <@freenodecom> This channel has been reopened with respect to the communities and new users. The topic is in violation of freenode policy: https://freenode.net/policies
# All channel modes reset (bans, quiets, …)
[2021-05-25T23:04:17-0400] OperServ sets mode +o freenodecom
[2021-05-25T23:04:17-0400] ChanServ sets mode +imnpscf-bbb ##webcore *!*@*shell/* *!*@*.powered.by.lunarbnc.net $a:average
GPG/PGP Signature Leader
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

About your project

@amcgregor
amcgregor / _summary.md
Last active May 21, 2021 12:54
Another user, ComCat, kicks up a fuss with the seeming intent of being banned.

Random anonymized user pops in, pops off thinking he's heping instead of hurting, gets banned.

Shocking no-one.

But, really, though. This is blatant enough for me to recognize as, potentially, the (or an agent of the) hostile agent attempting to sabotague good will more directly. It's hilarious and pathetic, but noteworthy.

More likely, though, it's one of the intermittently persistent assholes I've had to ban from ##webdev in the past. One held a grudge for three years crossing two networks whilst using autism as a defense for his bad behavior.

This adds "sad" to the pile with "hilarious" and "pathetic".

@amcgregor
amcgregor / libera-marrow-request.md
Created May 20, 2021 15:23
Project registration request for the Marrow Open Source Collective, covering a discrete channel (historical), one channel namespace, and one cloak namespace.
GPG/PGP Signature Leader
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

About your project

@amcgregor
amcgregor / ot.py
Last active June 28, 2021 16:12
A declarative description of Operational Transform (OT) operations developed with the context of Quill's Delta format for representation of rich text content changes.
"""An implementation of the Delta text markup format using MongoDB as back-end storage.
For details, please see:
- https://quilljs.com/guides/designing-the-delta-format/
- https://quilljs.com/docs/delta/
"""
from collections import deque
from weakref import proxy
@amcgregor
amcgregor / zip_longest_repeat_last.py
Last active December 4, 2020 14:36
Consume multiple iterators, filling each when exhausted with the last value they produced.
from itertools import repeat
def zip_longest_repeating(*iterables):
"""Consume multiple iterables, filling each when exhausted with the last value they produced, until all are exhausted."""
tracking = {} # Track the last value seen for each iterable passed in.
iterators = [iter(it) for it in iterables]
count = len(iterators)
if not count: return
@amcgregor
amcgregor / address-component.py
Last active February 16, 2021 01:45
An example "trivial" Contentment component. Note in particular that this is all "data model" — HTML is merely one possible serialization of the data. View is not defined here, there are no presentation details, but a method is provided to permit introspection of the view capabilities or requirements.
from marrow.mongo import Document, utcnow
from marrow.mongo.field import Date, Link
from ..asset import Depend
class Address(Document):
"""An embedded document representing a verified e-mail address.
Intended for use in an Array() embedding these sub-documents.
@amcgregor
amcgregor / rimworld-active-mods.txt
Created August 5, 2020 11:43
My current RimWorld playthrough's active game modification list, pulled straight outta the save.
Harmony
Core
Royalty
HugsLib
Miscellaneous 'CORE'
Misc. Robots
Misc. Training
Misc. MAI
Animals Logic
[KV] RimFridge - 1.1

Performance Bottlenecks

I've played a lot of Rimworld, for a long time (since early alphas), and certain specific things have remained as a noticeable, impactful burden on the game engine.

Roof Bit Map Updates

From the chunk of Base-64 encoded data in the save file, and the absolutely atrocious performance, I'm guessing the overhead roof tile state is stored in a packed C structure. Access of indexed tiles within this packed structure is expensive, and updating it even more so. The game begins to noticeably take large fractions of a full second per tile update, and when you've got an army of pawns working away, it stutters and stops and rushes forwards, and seemingly stops again, before going, for quite some time. It's dramatic, and roof construction/deconstruction is the single largest in-game performance impactor I encounter, by frequency.

See the video at the end.

@amcgregor
amcgregor / response.md
Last active June 27, 2020 19:07
YouTube have become more militant about blocking AdBlocker usage. 900+ comments, almost 5K votes, https://support.google.com/youtube/thread/10329866?hl=en&dark=1 is a heck of a thing. This is my own reply.

Safari AdBlock, disable "content blockers on this site" (right-click the address bar, Settings for This Website…) and instantly the video works again, however this problem exists on both monetized and non-monetized videos I attempt to play, for example, in my region this video from Jericho has no ads with AdBlock disabled, but enabled, refuses to play anyway. The &disable_polymer=true "workaround" does nothing for me except mangle the UI a bit. (Video is no longer full viewport width.)

I mean, sure, it's up to them to determine what they wish to support or not, and given advertisements are the financial model for the site, entirely reasonable and within their power to do what they can to protect that revenue. On the other hand, advertisements are widely regarded as malware and are very explicitly a malware infection vector (ref: MageCart attacks), and on the gripping hand: the privacy concerns of internet-wide tracking. There are multiple reasons to run ad blo