Skip to content

Instantly share code, notes, and snippets.

View g-plane's full-sized avatar

Pig Fang g-plane

View GitHub Profile
@g-plane
g-plane / highlight.js
Last active May 9, 2025 03:20
Replace highlight.js with Shiki in mdBook
window.hljs = {
/** @type {Promise<any>} */
shiki: undefined,
configure() {
this.shiki = import('https://esm.sh/[email protected]')
},
/** @param {HTMLElement} codeElement */
async highlightBlock(codeElement) {
const lang = [...codeElement.classList.values()]
.map((name) => name.match(/^language-(.+)$/)?.[1])
@g-plane
g-plane / bilibili-volume-control.user.js
Last active May 19, 2025 14:05
Bilibili Volume Control
// ==UserScript==
// @name Bilibili Volume Control
// @version 2025-05-19
// @description Smaller step for volume control on Bilibili video player.
// @author Pig Fang
// @match https://www.bilibili.com/video/*
// @match https://www.bilibili.com/list/watchlater*
// @match https://www.bilibili.com/bangumi/play/*
// @grant none
// ==/UserScript==