Skip to content

Instantly share code, notes, and snippets.

#!/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 / 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]*)$/
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})`)
}
// example input
const input = `
Disc 1
Composed by
John Doe (1, 2, 6~10)
Foo Bar (3)
Arranged by
Some Guy (1~10)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Relationship Combiner</title>
<style>
#output {
white-space: pre-wrap;
}
/* ==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== */