Skip to content

Instantly share code, notes, and snippets.

View hannahherbig's full-sized avatar

Hannah Herbig hannahherbig

View GitHub Profile
@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');
@hannahherbig
hannahherbig / tracker.rb
Created January 24, 2013 05:32
a dead simple torrent tracker in ruby
require 'bencode'
require 'sinatra'
torrents = {}
get '/announce' do
compact = (params[:compact] || '1') == '1'
no_peer_id = params[:no_peer_id] == '1'
event = params[:event] || 'empty'
numwant = (request[:numwant] || 50).to_i