Skip to content

Instantly share code, notes, and snippets.

View joezeng's full-sized avatar

Joe Z. joezeng

View GitHub Profile
@joezeng
joezeng / queue_tickets.py
Created August 31, 2020 23:59
Random queue tickets simulation for Mario Maker Viewer Levels (or anything else involving a queue on stream)
import random
from typing import NamedTuple
from collections import Counter
class QueueEntry(NamedTuple):
id: int
tickets: int
wait_time: int = 0
def wait(self, tickets):
@joezeng
joezeng / combo_tables.py
Last active July 19, 2019 00:00
Tetris combo table outputs
combo_tables = {
# JStris/TetrisFriends/etc. combo table
"tf": [
[0,],
[0,0,0,1,1,2,2,3,3,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5],
[0,1,1,2,2,3,3,4,4,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6],
[0,2,2,3,3,4,4,5,5,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7],
[0,4,4,5,5,6,6,7,7,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9],
],
# Worldwide Combos combo table
@joezeng
joezeng / corpus_analyzer.py
Created October 17, 2018 17:20
Corpus Analyzer for Stenography
import csv
import sys
import re
import os
from collections import Counter
print("Building corpus...")
nicknames = []
@joezeng
joezeng / falsehoods.md
Last active October 19, 2022 09:14
Falsehoods programmers believe about numbers

Falsehoods programmers believe about numbers

  1. Numbers always have exact expressions in data.

  2. Numbers always have exact expressions in data if I restrict the significant digits I work with and round them off hard enough.

  3. Multiplication is associative and commutative.

  4. Multiplication is invertible.

@joezeng
joezeng / fuckery.md
Last active July 22, 2018 18:25
This week in Javascript fuckery (July 15-21, 2018)

This week in Javscript fuckery:

const arr = [];
for (let a = 0; a < 10; ++a) {
    arr.push(a);
}
console.log(arr);

What does this output?

@joezeng
joezeng / restricted_rps.py
Last active March 17, 2018 04:11
Restricted RPS simulator
import random
from math import floor, ceil
from collections import Counter
class Player:
def __init__(self, id):
self.id = id
self.stars = 3
self.rock = 4
self.paper = 4