Skip to content

Instantly share code, notes, and snippets.

@ToadKing
ToadKing / mbrainz-combine-catnum.user.js
Last active April 2, 2024 04:19
Musicbrainz - Combine Catalog Numbers
// ==UserScript==
// @name Musicbrainz - Combine Catalog Numbers
// @namespace com.toadking.mb.catalog
// @match https://musicbrainz.org/*
// @grant none
// @version 1.4
// @author Toad King
// ==/UserScript==
const catNumRegExp = /^(.*?)(\d+)([^\d]*)$/
/* ==UserStyle==
@name HIDIVE - Better Subtitle Outline/Stroke
@namespace com.toadking.hidive
@version 1.0.0
@description Better subtitle outline/stroke effect on HIDIVE
@author Toad King
@preprocessor default
@var color strokeColor "Outline/Stroke Color" black
@var number strokeWidth "Outline/Stroke width" [0.15, 0, 1, 0.01, 'em']
==/UserStyle== */
<!DOCTYPE html>
<html lang="en">
<head>
<title>Relationship Combiner</title>
<style>
#output {
white-space: pre-wrap;
}
</style>
// example input
const input = `
Disc 1
Composed by
John Doe (1, 2, 6~10)
Foo Bar (3)
Arranged by
Some Guy (1~10)
import { readFileSync, writeFileSync } from 'fs'
async function get(url, options) {
const controller = new AbortController()
const { signal } = controller
const res = await fetch(url, { ...options, signal })
if (!res.ok) {
controller.abort()
throw new Error(`bad request (${res.status} ${res.statusText})`)
}
@ToadKing
ToadKing / gist:a5edb237cb3e4433c3f3
Created December 18, 2014 05:52
Wii U adapter emulator
// Super messy and adapted almost exclusively from libusb-gadget loopback example
/*
* Copyright (C) 2009 Daiki Ueno <ueno@unixuser.org>
* This file is part of libusb-gadget.
*
* libusb-gadget is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@ToadKing
ToadKing / gist:3b452a4121fede44a50f
Last active June 3, 2022 06:34
Wii U GC adapter - Working prototype
#!/bin/sh -e
# source: https://gist.github.com/ToadKing/006dd0eaa5f2cdc26b88bfb2d08b0e15
_name=firefox
_channel=nightly
_lang=en-US
_arch=x86_64
pkgname=${_name}-${_channel}
@ToadKing
ToadKing / pro.c
Created June 23, 2017 03:42
pro controller descriptors
// USB Device Descriptor
0x12, // bLength
0x01, // bDescriptorType (Device)
0x00, 0x02, // bcdUSB 2.00
0x00, // bDeviceClass (Use class information in the Interface Descriptors)
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
0x40, // bMaxPacketSize0 64
0x7E, 0x05, // idVendor 0x057E
<div id="wheel" ref="wheelContainer" :style="styles.wheel">
<img :style="styles.ticker"
ref="ticker"
:src="settings.ticker.url"/>
<div id="inner-wheel">
<img v-if="settings.centerImage.enabled"
:src="settings.centerImage.url"
:style="styles.centerImage" />
<svg viewBox="-1 -1 2 2"
xmlns="http://www.w3.org/2000/svg"