Skip to content

Instantly share code, notes, and snippets.

View rmmh's full-sized avatar

Ryan Hitchman rmmh

  • Boulder, Colorado
View GitHub Profile
@rmmh
rmmh / bb.java
Created January 10, 2019 05:49
Minecraft Mod: Optimine 1.3_01v2 Source Code.
import org.lwjgl.opengl.GL11;
public abstract class bb {
protected pd b;
private ic a = new dx();
private bw e = new bw();
protected float c = 0.0F;
protected float d = 1.0F;
@rmmh
rmmh / gist:4615975
Last active September 22, 2022 16:54
iclicker id obfuscation
def enc(id1, id2, id3):
''' encrypt the first three bytes of the ID
* the 4th byte of the ID is id1 ^ id2 ^ id3
* the top three bits of id1 are lost, meaning
there are 2^21 ~= 2M unique clicker IDs
source: reversed iclicker1 firmware '''
a = (id1 & 0x1F) << 3
a |= (id2 & 0x80) >> 5
a |= maskFrom3rd(a)
#!/usr/bin/env python3
# grab data from https://place.thatguyalex.com/
import glob
import numpy
import PIL.Image
import scipy.stats
@rmmh
rmmh / crunch.js
Last active February 20, 2022 04:55
wordle dictionary compression
function dec(xs) {
function n2w(n) {
var o = '';
for (var i = 0; i < 5; i++) {
var c = n % 26;
n = (n / 26)|0;
o += 'MGXJQZVBDCTWHFKSPNLREOAIUY'[c];
}
return o;
}
@rmmh
rmmh / gist:8491b8408f6830d18c1fa92d78cb6c36
Created October 29, 2021 18:36
Connect 2021 Carmack Talk Transcript

https://www.facebook.com/watch/live/?ref=watch_permalink&v=1264023127446649

Welcome to Connect 2021.

My process for these talks is that I basically go back through last year of internal posts and public tweets that I’ve made looking for things that are interesting and worthwhile to talk about ask then I try to roughly sort them in to some kind of a coherent topic flow. I’m also usually the one that’s lot more kind of grumpy and unhappy with the way things are going as I always want more and faster progress. But this year, I really have a lot of things to be quite happy about. By far the most important is that quest 2 has been a really big success and it was a heroic effort to get it out when it was last year in the space of all the headwinds that we had, but it was better, faster, cheaper, one of those just rare combinations that you almost never get to have in a product.

00:01:31 While there’s still a couple minor things where some people miss the displays or continuous IPD adjustments, it was a fantastic

@rmmh
rmmh / gist:8515577
Created January 20, 2014 05:53
MSP430 Alphanumeric Instructions
[0-9a-zA-Z]{2}
30-39,41-5a,61-7a
a:61 z:7a A:41 Z:5a 0:30 9:39
MSP430 alphanumeric shellcode is hard. There's no way to write to memory,
no word-sized reg-reg operations, and all we have is add/sub/mov and a few conditional jumps.
#!/usr/bin/env python3
import re
import urllib
import dateutil
import requests_cache
session = requests_cache.CachedSession(allowable_codes=(200, 404))
session.headers['User-Agent'] = 'CovidDeathsPopularity/1.0 (hitchmanr@gmail.com) python3/requests'
#!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@rmmh
rmmh / paths.go
Last active April 25, 2021 02:39
worm-polyomino counting
// How many distinct closed paths visit each cell in an NxN grid exactly once?
package main
import (
"fmt"
"math/bits"
)
type walls struct {
@rmmh
rmmh / gist:6bcc6de6153f0467b1bec686a9ad832d
Created July 16, 2019 09:05
Project Gutenberg Initialisms
#!/usr/bin/env python3
# an experiment in using a large corpus of phrases to generate initialisms from
import re
import zipfile
from nltk import tokenize
phrases = {}