Skip to content

Instantly share code, notes, and snippets.

View gibson042's full-sized avatar

Richard Gibson gibson042

View GitHub Profile
@gibson042
gibson042 / esbench.sh
Last active September 5, 2024 12:19
ad hoc multi-engine JavaScript benchmarking
#!/bin/sh
# TODO start versioning
usage () { awk -v CMD="$0" '{ gsub(/\$0/, CMD); print }' <<'END_USAGE'
Usage: $0 [OPTION]... [--] SETUP VARIATIONS
Measures the performance of code variations in multiple ECMAScript implementations.
Options:
--number COUNT, -n COUNT
The count of timed iterations of each variation (defaults to 1000).
@gibson042
gibson042 / github-fixer.user.js
Last active January 3, 2025 20:08
GitHub Fixer user script
// ==UserScript==
// @name GitHub Fixer
// @namespace https://github.com/gibson042
// @description Sticky pull request tabs, filter CI checks by status, expand all toggles on <{Alt,Option}+Shift+E>.
// @source https://gist.github.com/gibson042/d8ab425d133400959bc5bb875898a97b
// @updateURL https://gist.github.com/gibson042/d8ab425d133400959bc5bb875898a97b/raw/github-fixer.user.js
// @downloadURL https://gist.github.com/gibson042/d8ab425d133400959bc5bb875898a97b/raw/github-fixer.user.js
// @version 0.6.1
// @date 2025-01-03
// @author Richard Gibson <@gmail.com>
@gibson042
gibson042 / user-scripts.md
Created September 8, 2023 22:17
User scripts

A collection of user scripts with no other home, for use with Greasemonkey, Tampermonkey, and similar browser extensions.

General Use

Suitable on all sites.

  • Anchors Up - Navigates to in-page anchors upon {Command,Ctrl}+click or (with Shift) scrolls to arbitrary elements.
  • Editor Tweaks - &lt;{Command,Ctrl}+[;BIK…]> commands to control Markdown inside textareas, {Command,Ctrl}+Alt+mousedown to toggle monospace.
<link rel="stylesheet" href="https://fred-wang.github.io/MathFonts/STIX/mathfonts.css">
<style>
mtd[columnalign=left] { text-align: left; }
mtext { display: inline; white-space: pre-wrap; }
</style>
<h1>Value first</h1>
Let <var>final</var> be <math>
<mrow>
<mo>{</mo>
@gibson042
gibson042 / git-diff-to-ecmarkup.cjs
Last active July 5, 2025 21:08
A script for translating `git --word-diff=plain` output into ecmarkup-compatible <ins>/<del> tags
#!/usr/bin/env node
/**
* Usage:
* git diff --numstat | sed 's/.*\t//' | while read f; do
* t="$(mktemp -p "$(pwd)" "$f.XXXXXX")"
* git diff -U99999 --minimal --word-diff=plain -- "$f" | sed '1,/^@@/d' | $0 > "$t"
* chmod --reference="$f" "$t"
* mv -f "$t" "$f"
* done