Skip to content

Instantly share code, notes, and snippets.

@lordmortis
lordmortis / BaseRecord.cs
Created July 26, 2022 09:38
BaseRecord file
public abstract class BaseRecord : ScriptableObject, ISerializationCallbackReceiver
{
public Guid Id { get; internal set; } = Guid.Empty;
public string HumanName => humanName;
[SerializeField] internal string humanName;
[SerializeField] private byte[] idBytes;
public virtual void OnBeforeSerialize()
{
@lordmortis
lordmortis / antlr4
Last active March 9, 2019 07:46
Example antlr4 shell script
#!/bin/sh
# you will need to change the path below to the location of your antlr4 download
java -jar /Users/lordmortis/bin/java/antlr-4.7.1-complete.jar "$@"
Position | Hex | Notes
0 - 4 | 5941524e | File Type
4 - 11 | 0105302e312e30 | Version 0.1.0
11 - 13 | 0117 | Function Table Index (starts at 23)
13 - 15 | 0122 | Variable Table Index (starts at 34)
15 - 17 | 0145 | Text Fragment Table Index (starts at 69)
17 - 20 | 022904 | Node Name Table Index (starts at 1065)
20 - 23 | 025504 | Command List Index (starts at 1109)
23 - 34 | -- | -------Function Table Table-------
23 - 25 | 0101 | Table is 1 entries long
@lordmortis
lordmortis / Article excerpt
Created June 23, 2017 03:18
article excerpt
In these places, the proportion of 18-25-year-olds was high enough that they could swing the election — if they turned out at the national average. Using the photograph of the person who’d lent their profile, the program would automatically swipe “yes” on every user, and if someone swiped “yes” back, creating a “match,” the bot would ask about the user’s voting plans.If the user planned to vote for Labour (or whatever party best placed to beat the Conservatives), the bot sent a message with a link to the nearest polling station. If the user planned to vote for another progressive party, the bot asked if he or she would consider a tactical vote to beat the Tories, voting for the progressive party most likely to beat the Conservatives in their area. And if the user was voting for a right-wing party or was unsure, the bot sent a list of Labour policies, or a criticism of Tory policies. People who lent their profiles could jump in and chat at any time. And they did.
@lordmortis
lordmortis / gist:d817e44b075106ae3fb6
Last active August 29, 2015 14:17
Thoughts upon the death of Terry Prachett

I don't often write blog posts (hence the lack of a blog) - which will be vaguely surprising to a lot of the people mentioned in the first few parts of this text.

I am, however, a programmer - That's why this got posted to Github.

On Thursday night, very late as I just getting to sleep, I saw the following tweets (in stereo, as I follow both Rhianna Prachett and her father)

  1. AT LAST, SIR TERRY, WE MUST WALK TOGETHER
  2. Terry took Death’s arm and followed him through the doors and on to the black desert under the endless night.
  3. The End.
@lordmortis
lordmortis / keybase.md
Created February 26, 2015 10:30
Keybase Verification

Keybase proof

I hereby claim:

  • I am lordmortis on github.
  • I am lordmortis (https://keybase.io/lordmortis) on keybase.
  • I have a public key whose fingerprint is 1982 C55A 723F 0690 6A12 2A18 D22F 9FF2 CB8D BC69

To claim this, I am signing this object:

@lordmortis
lordmortis / gist:ed1eabb96715a64d42d3
Created January 26, 2015 04:07
Time Lapse Screenshots for Mac OS X
#!/bin/sh
while [ 1 ]; do
vardate=$(date +%d\-%m\-%Y\_%H.%M.%S);
screencapture -x $vardate.png
sleep 6s
done
@lordmortis
lordmortis / gist:a76597771d04ea1c15e7
Created December 15, 2014 06:34
X-men cold open
Miles: "Hey rachel, remember Lo'landra, professor x's space bird girlfriend?"
Rachel: "Miles, everyone remembers Lo'landra, they were together for like 30 years"
Miles: "Wait, they're not still together?"
Rachel: "Dude, first of all she's dead, and shockingly, there are lines even Xavier won't cross but that's not even relevant 'cause they split up during the Morrison run. "
Miles: "Was that a Cassandra nova thing? Do you really think you can explain Cassandra nova in a cold open?"
Rachel: "Is that a challenge?"
Miles: "Fuuuuuuccckk."
Rachel: "Okay, So: Cassandra nova is a (?) - Professor X's evil disembodied physic twin, Whlie they were gestating she tried to clone herself a body based on his but fetus X strangled her so she was born as nothing but a malevolent conciousness"
Miles: "Oh god, what horror have I unleashed? I am so sorry listeners!"
Rachel: "Decades later, Cassandra manages to produce an adult body which she uses to unleash the sentinels on genosha decimating the mutant population then made her
➜ ~ dig apple.com @203.0.178.191
; <<>> DiG 9.8.3-P1 <<>> apple.com @203.0.178.191
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 14586
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;apple.com. IN A