Skip to content

Instantly share code, notes, and snippets.

View amcgregor's full-sized avatar
🏢
I died! …well, I got better…

Alice Zoë Bevan–McGregor amcgregor

🏢
I died! …well, I got better…
View GitHub Profile
@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

@amcgregor
amcgregor / gist:c6492bb8f522f33c2792ff1b6b105d75
Last active June 29, 2020 14:43
[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.
<!DOCTYPE html>
<html lang="en">
<title>Unsubscribed</title>
<style>
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
amcgregor / 1-op.md
Last active May 14, 2020 04:38
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. https://steamcommunity.com/app/410900/discussions/5/2270319981527105014/#c2271447149952963988

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

FORTS on Mac OSX

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

@amcgregor
amcgregor / capricious-gods.md
Last active May 4, 2020 12:04
A minor bloggy-post after some games, music, and discussion got me thinking on "artificial" life. Prove you're alive.

https://www.reddit.com/r/RimWorld/comments/gdacmi/we_are_capricious_gods/

it'll be interesting if we ever get "wetware" computers
but i can imagine that crossing some heavy ethical lines, i have no mouth and yet i must scream style

I already grapple with the ethical considerations of simulating colonists/villagers in RimWorld. The game calls them "pawns".

These people have full back-stories, lives, personalities, preferences, and quirks. Some struggle with addictions, chemical and engineered.  They posess sentience in the perception of their environment and self-awareness of things like their comfort, or hunger. Emotional states and fragility tied to relationships, maintaining them, and inter-personal interactions.  It's actually quite troublesome for me, in that not only do I have villagers grappling with the in-game moral ramifications of mulching the stone-age raiders into ethanol, now my frickin' roombas are developing psychological issues from it. I feel bad for the little lamp not becau

@amcgregor
amcgregor / pm.log
Last active May 6, 2020 04:06
He-Man IRC log pre-ban from in-channel ##webdev (background patterns of behavior) and the private message conversation / moderation warning and responses had on irc.freenode.net. That second file is so lacking in self-awareness, civility, and anything other than misogyny, that it'd be hilarious if it weren't so hideously painful to see.
[2020-04-17T03:12:11-0400] <zro> np
[2020-04-17T03:19:40-0400] rendar (~rendar@unaffiliated/rendar) joined the channel
[2020-04-17T03:21:49-0400] He-Man (~i.am@unaffiliated/policequest) joined the channel
[2020-04-17T03:21:54-0400] <He-Man> hi all
[2020-04-17T03:22:02-0400] <He-Man> could someone help me with my first website?
[2020-04-17T03:23:34-0400] <no_gravity> He-Man: In general we help with the building blocks. So if you have a question about a DIVs, a SPANs or the BLINK element, please ask!
[2020-04-17T03:23:58-0400] <He-Man> actually im looking for a feedback
[2020-04-17T03:24:05-0400] <He-Man> better ideas, etc
[2020-04-17T03:24:15-0400] <no_gravity> Oh! Show us!
[2020-04-17T03:24:22-0400] <He-Man> wow i can just post the link here?