Skip to content

Instantly share code, notes, and snippets.

@oshoham
oshoham / recorder-processor.js
Created June 24, 2019 22:51
ES5 AudioWorklet Processor
function RecorderProcessor(options) {
AudioWorkletProcessor.call(this);
var processorOptions = options.processorOptions || {};
this.numInputChannels = processorOptions.numInputChannels || 2;
this.recording = false;
this.clear();
this.port.onmessage = function(event) {
@oshoham
oshoham / package.json
Last active August 5, 2020 01:35
Parse the Book of Blaseball from the site's minified JavaScript
{
"name": "blaseball-book-scraper",
"version": "1.0.0",
"description": "",
"main": "parse_blaseball_book.js",
"author": "",
"license": "ISC",
"dependencies": {
"acorn": "^7.4.0",
"acorn-walk": "^7.2.0",
@oshoham
oshoham / parse_blaseball_book.py
Last active August 9, 2020 18:43
Parse the Book of Blaseball from the site's minified JavaScript (Python 3 version)
import esprima
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin
class BookOfBlaseballVisitor(esprima.NodeVisitor):
def find_book_function_node(self, node):
self._ancestors = []
self._book_function_node = None