Skip to content

Instantly share code, notes, and snippets.

View jonashw's full-sized avatar

Jon Wilson jonashw

  • Yolo County, California
View GitHub Profile

Alternatives Analysis Specification


Required Content

Each AA document must include:

  1. Clearly defined problem statement and background context.
  2. Detailed exploration of at least two viable solutions, including comparative analysis.
  3. Explicit identification of trade-offs, including considerations like cost, scalability, maintainability, and reversibility.
@jonashw
jonashw / gfm-dsl-showcase.md
Created July 22, 2026 16:36
Showcase of DSLs in GitHub-Flavored Markdown

GitHub Flavored Markdown (GFM) DSL Showcase

This file serves as a live demonstration of the specialized Domain-Specific Languages (DSLs) that GitHub natively renders into interactive elements, rather than just treating them as plain code text.


1. LaTeX Math Expression

GitHub uses MathJax to parse inline and block-level mathematical notation.

The Workflow Formula:

(function() {
/* Grabs the images for all OVERDUE materials on the WPL "Checked Out" page,
** assembles them in a new page, and invokes the system print dialog.
** Run from https://woodland.aspendiscovery.org/MyAccount/CheckedOut
*/
'use strict';
printImages(Array.from(document.querySelectorAll('.striped > div.result.bg-overdue img')));
function printImages(imgElements) {
const w = window.open('', '_blank');
@jonashw
jonashw / Bookmarklet-Maker.js
Last active July 30, 2026 13:06
Bookmarklet Maker
// ==UserScript==
// @name Bookmarklet Maker
// @namespace http://tampermonkey.net/
// @version 2026-06-11
// @description A lean and mean JavaScript-only SPA that facilitates the creation of bookmarklets from JavaScript code. Inspiration: https://caiorss.github.io/bookmarklet-maker/. Fun fact! You can package this tool *as a bookmarklet* using the tool itself ;)
// @author Jon Wilson <2jonwilson@gmail.com>
// @source https://gist.github.com/jonashw/83be75a1cd63537259070a430395d486
// @match https://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
@jonashw
jonashw / gist:e503e6558c4504219bf8bbaf4502adc6
Last active June 11, 2026 20:14
Tamper Monkey script: Print Cover Images of Overdue Materials
// ==UserScript==
// @name Print Cover Images of Overdue Materials
// @namespace http://tampermonkey.net/
// @version 2026-06-11
// @description Grabs the images for all OVERDUE materials on the WPL "Checked Out" page, assembles them in a new page, and invokes the system print dialog.
// @author You
// @match https://woodland.aspendiscovery.org/MyAccount/CheckedOut
// @icon https://www.google.com/s2/favicons?sz=64&domain=aspendiscovery.org
// @grant none
// @source https://gist.github.com/jonashw/e503e6558c4504219bf8bbaf4502adc6
@jonashw
jonashw / gist:d314c2b1dd0e08948bb588245344a4ef
Last active June 8, 2026 22:17
Browser Network Observer
// ==UserScript==
// @name BrowserNetworkObserver
// @description Captures all fetch/XHR traffic via callback and Observable interfaces.
// @match *://*/*
// @run-at document-start
// @grant none
// @source https://gist.githubusercontent.com/jonashw/d314c2b1dd0e08948bb588245344a4ef
// @version 2026-06-08
// ==/UserScript==
// Specification: https://gist.github.com/jonashw/df8c914c706a50ce1a73e86740bd210c

ADR: NetworkObserver Injection Method

Context

We need to inject NetworkObserver into the browser before any page scripts execute so that all fetch/XHR traffic is captured from page load.

Decision

Tampermonkey userscript for immediate use; custom Chrome extension as a future option if more control is needed.

@jonashw
jonashw / Sample Sum Type
Last active June 20, 2016 18:24
This is typically how I implement a sum type in C# for day-to-day use. At the bottom is the code I wish I could write instead.
//So much boilerplate!
public abstract class UserAccountCreationResult
{
private UserAccountCreationResult() { }
public UserAccountCreationResult AsBaseType() => this;
//Emulate pattern matching
public abstract T Match<T>(
Func<Success, T> success,
Func<WeakPassword, T> weakPassword,
SELECT
p.ProjectID,
p.FourHTitle,
rt.RecordTypeID,
rt.RecordTypeName,
rt.RecordTypeDescription,
( SELECT COUNT(1)
FROM c_RecordTypeConfiguration
WHERE OrganizationID = 25
AND RecordTypeID = rt.RecordTypeID
function extend(destination, source) {
for (var k in source) {
if (source.hasOwnProperty(k)) {
destination[k] = source[k];
}
}
return destination;
}
function getFileServicesHost() {