Skip to content

Instantly share code, notes, and snippets.

Working from home

Alice Zoë Bevan–McGregor amcgregor

Working from home
View GitHub Profile
amcgregor /
Created Mar 12, 2021
Mr0rris0 from got himself banned from a web development channel. Welp, be immortalized as a BOFH warning to others. Can't really be arsed to put enough effort in to glorify his initial ravings, but given the dates are included below, I'll have them if requested, I suppose.

A hiliariously sad slash pathetic walking demonstrative stereotype. Using a channel for one purpose as a personal #linux, amongst other issues.

Name hopping and buner accounts for ban avoidance, a half dozen aliases at one point… the whole song, dance, WITH jazz-hands.

Like, yikes.

amcgregor /
Last active Dec 4, 2020
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 /
Last active Feb 16, 2021
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 / rimworld-active-mods.txt
Created Aug 5, 2020
My current RimWorld playthrough's active game modification list, pulled straight outta the save.
View rimworld-active-mods.txt
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 /
Last active Jun 27, 2020
YouTube have become more militant about blocking AdBlocker usage. 900+ comments, almost 5K votes, 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

amcgregor / gist:c6492bb8f522f33c2792ff1b6b105d75
Last active Jun 29, 2020
[MOVED] An initial quick pass at a "dark colour scheme" for GitHub based on their latest design work. I like it, I just wish it were less blinding.
View cornershop-unsubscribe.html
<!DOCTYPE html>
<html lang="en">
body { min-height: 100vh; display: flex; align-items: center; justify-content: center; font-family: "Helvetica Neue", Arial, sans-serif }
main { width: 500px; margin: 10px; text-align: center }
h1 { color: #90A4AE; font-size: 24px; line-height: 29px; font-weight: normal }
h2 { color: #3B9F55; font-size: 25px; line-height: 30px; border: 3px solid #3B9F55; padding: 36px 20px }
a { color: #90A4AE }

Emerald: #NotallPolice

Black Santo Nino: #MostPolice

#EnoughPolice to ruin public trust and the social glue of assumed compliance towards law enforcement; the "bad eggs" ruin the rule of law for everyone.

Yes, that was a fancy way of saying: this will keep happening until people literally won't put up with it any more, and cease standing by recording while murders happen. I do not understand how that officer wasn't bodily tackled by a bystander—let alone the off-duty emergency services personnel on-scene—after even one minute of kneeling on his neck.

Those present with phones in hand will have to live with the fact they were present to witness a murder, and didn't intervene.

amcgregor /
Last active May 14, 2020
A reply to a thread asking for macOS platform support, where the game developer has used the ever classic "it's a custom engine" excuse.

I've seen some people manage to get it working on Mac by following this Steam guide from one of the devs:


But it seems pretty finicky about which models it decides to work with and which it does not.