Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/nodejs
"use strict";
require("prfun/smash");
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");

ARM compared with AVR

Disclaimer

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.

Overview

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

@kotarou3
kotarou3 / timetable-formatter.js
Last active July 20, 2016 19:26
Format UNSW timetable for conversion to PDF
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())
result.push(elem);
return result;
剕 [あしきり] /(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
kotarou3 / 0001-Hack-in-C++-support.patch
Last active March 6, 2017 08:38
For COMP9242 16s2
From 16fb4aa41e1ac236cf1f57747b70ab650292658d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E5=A4=AA?= <nospam@kota.moe>
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
provided.
@kotarou3
kotarou3 / singleprocesshack.diff
Last active June 1, 2021 08:27
Pokemon Showdown single process hack
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) {

Liquid Cooling Quick-Disconnect Comparison

The accompanying CSV compares various liquid cooling quick-disconnect couplers that satisfy the following criteria:

  • No-spill (<100µL loss on disconnect)
  • Hand mate (requires releasing an interlock to disconnect)
  • Material compatible with a copper loop (e.g., brass, plastic, stainless steel)
  • 0~60°C operating temperature
  • Nominal inner diametre of 6~10mm

RTMP to Discord stream (GoLive) conversion

Overview

This guide sets up nginx to convert a RTMP stream to HLS, which then can be opened in browsers. Discord can then take advantage of Chromium's tab sharing feature to stream the HLS stream. Only a few seconds of latency are added, which is acceptable for most applications.

Note: If your goal is to just get audio streaming working on Linux, this guide might be helpful (It results in lower FPS for me, however):

We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
#,Item,Theme[0],Theme[1],,Material[0],Amount[0],Material[1],Amount[1],Material[2],Amount[2],Material[3],Amount[3],LevelReq,CraftingTime,Value
0,"","","",0,"Island Palm Leaf",0,"Island Palm Leaf",0,"Island Palm Leaf",0,"Island Palm Leaf",0,0,0,0
1,"Isleworks Potion","Concoctions","",0,"Island Palm Leaf",2,"Islewort",2,"Island Palm Leaf",0,"Island Palm Leaf",0,1,4,28
2,"Isleworks Firesand","Concoctions","Unburied Treasures",0,"Island Sand",2,"Island Limestone",1,"Islewort",1,"Island Palm Leaf",0,1,4,28
3,"Isleworks Wooden Chair","Furnishings","Woodworks",0,"Island Log",4,"Island Vine",2,"Island Palm Leaf",0,"Island Palm Leaf",0,1,6,42
4,"Isleworks Grilled Clam","Foodstuffs","Marine Merchandise",0,"Island Clam",2,"Island Laver",2,"Island Palm Leaf",0,"Island Palm Leaf",0,1,4,28
5,"Isleworks Necklace","Accessories","Woodworks",0,"Island Branch",3,"Island Vine",1,"Island Palm Leaf",0,"Island Palm Leaf",0,1,4,28
6,"Isleworks Coral Ring","Accessories","Marine Merchandise",0,"Island Coral",3,"Island Vine",3,"I
# Scores Mudfish "advanced mode" nodes since the built-in tool isn't very useful.
# Run with: scrapy runspider mudfish.py
import json
import re
import scrapy
srcIp = "110.175.213.58"
destIp = "124.150.157.158"
srcCountry = "AU"