Skip to content

Instantly share code, notes, and snippets.

View hannahherbig's full-sized avatar

Hannah Herbig hannahherbig

  • Brooklyn, NY
  • 05:27 (UTC -04:00)
View GitHub Profile
@hannahherbig
hannahherbig / index.html
Created November 22, 2016 17:35
shellsort voronoi
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path { stroke: none; }
</style>
<svg width="960" height="500"></svg>
<script src="//d3js.org/d3.v4.min.js"></script>
<script>
var svg = d3.select('svg')
var w = +svg.attr('width')
@hannahherbig
hannahherbig / .block
Last active November 19, 2016 06:00
quicksort 2
license: mit
height: 960
@hannahherbig
hannahherbig / .block
Last active November 20, 2016 22:51
quicksort
license: mit
height: 960
import requests
import time
class API:
def __init__(self, key):
self.key = key
def get(self, path, **args):
if path == 'replay':
time.sleep(6)
10 rupees
stick
lw escape
wess to kak
bottle
80 rupees
buy shield
dot skip
sw
@hannahherbig
hannahherbig / np.py
Created September 9, 2016 05:47
write currently playing song in osu to a file - this code sucks though so don't use it
import ctypes
import time
import re
RE_TITLE = re.compile(r'''^osu\![^\-]+\-\s+(.+)$''')
user32 = ctypes.windll.user32
EnumWindows = user32.EnumWindows
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool,
ctypes.POINTER(ctypes.c_int),
@hannahherbig
hannahherbig / upload.sh
Created August 30, 2016 07:37
script to render, mux, and upload osu replay video thingies to yt
PATHNAME="songs/kokou"
TITLE='50 replays - Yousei Teikoku - Kokou no Sousei [Chaos]'
MAP="https://osu.ppy.sh/b/118068&m=0"
BASENAME="$(basename $PATHNAME)"
MP3=($PATHNAME/*.mp3)
python multi_image.py "$PATHNAME" && \
ffmpeg -framerate 60 -i "out/$BASENAME-%05d.png" -i "$MP3" -map 0:v:0 -map 1:a:0 -c copy "$BASENAME.avi" && \
youtube-upload "$BASENAME.avi" -t "$TITLE" -d "map: $MAP\nsoource: https://github.com/andrew12/osr-stuff"
@hannahherbig
hannahherbig / index.js
Created May 15, 2014 18:20
requirebin sketch
var console = require('demo-console')
process.nextTick(function () {
console.log('hi')
})
require 'bigdecimal'
max = min = count = start = last = bank = nil
$<.each_line do |line|
line.strip!
case line
when /^Starting with BANK of (.+) BTC$/
start = last = bank = BigDecimal.new($1)
count = 0
max = BigDecimal.new(-1) / 0
var events;
events = require('
Obj events
Key EventEmitter');