Skip to content

Instantly share code, notes, and snippets.

kotarou3 / singleprocesshack.diff
Last active Jun 1, 2021
Pokemon Showdown single process hack
View singleprocesshack.diff
diff --git a/battle-engine.js b/battle-engine.js
index a8d1d27..4cb79c9 100644
--- a/battle-engine.js
+++ b/battle-engine.js
@@ -20,9 +20,9 @@ if (!('existsSync' in fs)) {
global.config = require('./config/config.js');
// graceful crash - allow current battles to finish before restarting
-process.on('uncaughtException', function (err) {
+/*process.on('uncaughtException', function (err) {

Stream audio from Windows to Linux

Tested on Ubuntu 16.04 and Windows 10 Redstone 1

Both boxes need to be on the same network (such that multicast packets can be passed between them)



  1. Setup JACK (easy to do with Cadence)


kotarou3 /
Last active Feb 21, 2019
Find top-level packages of the dependency graph for debian packages
import argparse, sys
import apt
import networkx as nx
parser = argparse.ArgumentParser(
description = "Find top-level packages of the dependency graph"
View Tournament

Tournament Guide

When tournament sign-ups are opened, you will see a interface drop down from the top of the chat area. There will be a button to join if you're not in the tournament and a button to leave if you are. Alternatively, the commands /tour join and /tour leave can be used instead. Please resist any urge to spam joins and leaves since it is a bannable offence.
Once you join the tournament, the bracket will already by displayed. However, do not challenge anyone yet. Please wait until someone starts the tournament.
When the tournament starts, you should see the leave button replaced with information about any match-ups you have. Challenge drop downs and buttons will appear if you are matched up to challenge another user. Please use the interface to challenge the user rather challenging the "normal" way because otherwise it won't count as a tournament match.


  • Run /tour by itself for a list of currently running tournaments
  • The tournament bracket becomes dragg
View 0001-Hack-in-C++-support.patch
From 16fb4aa41e1ac236cf1f57747b70ab650292658d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E5=A4=AA?= <>
Date: Thu, 4 Aug 2016 21:55:53 +1000
Subject: [PATCH] Hack in C++ support
Also via a unusual method to update the musl version without creating a huge
diff that give won't accept.
musl needed to be updated because libc++ depends on a newer one than the one
View words-dict.edict2
剕 [あしきり] /(n) (arch) (See 五刑) cutting off the leg at the knee (form of punishment in ancient China)/EntL2542150/
劓 [はなきり] /(n) (arch) (See 五刑) cutting off the nose (form of punishment in ancient China)/EntL2542140/
匜;半挿 [はそう;はぞう] /(n) (1) (esp. ) wide-mouthed ceramic vessel having a small hole in its spherical base (into which bamboo was probably inserted to pour liquids)/(2) (See 半挿・はんぞう・1) teapot-like object made typically of lacquerware and used to pour hot and cold liquids/EntL2791750/
噯;噯気;噫気;噯木(iK) [おくび(噯,噯気);あいき(噯気,噫気,噯木)] /(n) (uk) belch/eructation/burp/EntL2007450X/
垜;安土;堋 [あずち] /(n) mound on which targets are placed (in archery)/firing mound/EntL2542010/
杮;木屑;柿(iK) [こけら] /(n) (1) chopped wood/wood chips/(2) (abbr) (See こけら板) thin shingles/EntL2097450/
棈;阿部槙(ateji) [あべまき;アベマキ] /(n) (uk) Chinese cork oak (Quercus variabilis)/EntL2827052/
楣;目草 [まぐさ] /(n) (uk) {archit} (See 蹴放し) lintel (lacking the grooves needed for a sliding door)/EntL2056390X/
氐 [てい] /(n) (1) Di (ancient Chinese ethnic group)/(2) {as
kotarou3 / timetable-formatter.js
Last active Jul 20, 2016
Format UNSW timetable for conversion to PDF
View timetable-formatter.js
let printoutHeight = 18; // In centimetres
function xpath(node, path) {
let elems = document.evaluate(path, node, null, XPathResult.ANY_TYPE, null);
let elem;
let result = [];
while (elem = elems.iterateNext())
return result;
View ARM compared with

ARM compared with AVR


This document will be based on the ARMv8-A architecture, mainly focusing on AArch64, and comparing it to ATmega2560's megaAVR architecture.
Thus "ARM" will be used to mean "ARMv8-A AArch64" and "AVR" as "megaAVR".

Microarchitectural details for ARM are taken from the Cortex-A57.


Focusing on the differences between ARM and AVR, ARM has:

View git-find-blobs.js
"use strict";
const co = require("co");
const execFile = Promise.guard(
require("os").cpus().length + 1,
(cmd, args) => require("mz/child_process").execFile(cmd, args, {maxBuffer: 100 * 1024 * 1024})
const fs = require("mz/fs");
kotarou3 / examine-middlewares.js
Created Feb 3, 2016
Scripts to help with examining middlewares
View examine-middlewares.js
function examineMiddlewares(middlewares) {
"use strict";
let results = [];
for (let middleware of middlewares) {
let script = %FunctionGetScript(middleware);
let position = %FunctionGetScriptSourcePosition(middleware);
let line = script.source.slice(0, position).split("\n").length - 1;
let source = %FunctionGetSourceCode(middleware);