Skip to content

Instantly share code, notes, and snippets.

View hannahherbig's full-sized avatar

Hannah Herbig hannahherbig

  • Brooklyn, NY
  • 04:35 (UTC -04:00)
View GitHub Profile
import Tournament, { Id } from "./tournament";
export type DuelOptions = { short?: boolean; last?: number };
export default class Duel extends Tournament {
constructor(numPlayers: number, opts?: DuelOptions);
invalid(numPlayers: number, opts?: DuelOptions): boolean;
right(id: Id): [Id, number];
down(id: Id): [Id, number];
}
@hannahherbig
hannahherbig / coachella_times.py
Created April 24, 2022 01:17
fetch the times for coachella streams and make a message formatted for discord
import asyncio
import aiohttp
import lxml.html
import lxml.etree
import re
import arrow
async def main():
import numpy as np
import pytesseract
import cv2
from PIL import ImageGrab, Image
import pyperclip
cap = ImageGrab.grab(bbox=(400, 420, 1400, 520))
img = cv2.bitwise_not(cv2.cvtColor(np.array(cap), cv2.COLOR_BGR2GRAY))
for i in range(len(img)):
for j in range(len(img[i])):
@hannahherbig
hannahherbig / bailfunds.md
Last active May 31, 2020 19:12
markdown links to bail funds, particularly for twitch panels
import os
import math
import hashlib
from tqdm import tqdm
units = 'BKMGTPEZY'
def human(x):
if x > 0:
import argparse
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-major', action='store_true')
group.add_argument('-minor', action='store_true')
group.add_argument('-patch', action='store_true')
parser.add_argument('--file', '-f', default='VERSION')
args = parser.parse_args()
@hannahherbig
hannahherbig / music_db.py
Last active March 1, 2018 05:11
run this in a directory with rescaled music_db.xml, it reads song titles and ratings from there (don't use the english patched one)
import xml.etree.ElementTree as ET
from collections import defaultdict
import csv
from functools import lru_cache
@lru_cache(1024)
def lev(s1, s2):
"""Returns the levenshtein distance between strings s1 and s2."""
if not len(s1): return len(s2)
if not len(s2): return len(s1)
@hannahherbig
hannahherbig / .block
Created November 29, 2017 03:04
SDVX 4 difficulty totals
license: gpl-3.0
state("Refunct-Win32-Shipping")
{
int level : 0x01E0804C, 0x788, 0x78, 0x2B0, 0x10C, 0xA0;
int resets : 0x01E0804C, 0x788, 0x78, 0x2B0, 0x10C, 0xA4;
int startSeconds : 0x01E0804C, 0x788, 0x78, 0x2B0, 0x10C, 0xA8;
float startPartialSeconds : 0x01E0804C, 0x788, 0x78, 0x2B0, 0x10C, 0xAC;
int endSeconds : 0x01E0804C, 0x788, 0x78, 0x2B0, 0x10C, 0xB0;
float endPartialSeconds : 0x01E0804C, 0x788, 0x78, 0x2B0, 0x10C, 0xB4;
}
@hannahherbig
hannahherbig / .block
Last active December 7, 2018 14:56 — forked from mbostock/.block
Better Quicksort V
license: gpl-3.0