Skip to content

Instantly share code, notes, and snippets.

View nicjansma's full-sized avatar

Nic Jansma nicjansma

View GitHub Profile
@nicjansma
nicjansma / bricklink-order-get-minifigs.js
Created July 24, 2026 14:00
Adds loose Minifigs from a BrickLink order to your Brickset Collection
@nicjansma
nicjansma / compare-images-in-directories.sh
Created July 30, 2025 00:17
compare-images-in-directories.sh - finds matching images in two sets of directories under a DSSIM similarity threshold
#!/bin/bash
# Enhanced version that can use dssim, ssim, or ImageMagick
# Usage: ./enhanced_compare.sh <directory1> <directory2> [threshold] [method]
DEFAULT_THRESHOLD=0.01
DEFAULT_METHOD="auto"
usage() {
echo "Usage: $0 <directory1> <directory2> [threshold] [method]"
@nicjansma
nicjansma / fiddler-boomerang-helpers.js
Last active February 4, 2025 08:35
Fiddler FiddlerScript helpers for Boomerang
//
// Helper Functions
//
// Gets a parameter from the URL
static function extractGetParameter(name, query) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(query) || [,""])[1].replace(/\+/g, '%20')) || null;
}
// Gets a POST or GET parameter
@nicjansma
nicjansma / boomerang-dimensionstickyplugin.js
Created July 15, 2024 20:29
Boomerang DimensionStickyPlugin
/**
* The Boomerang DimensionStickyPlugin plugin will make a Custom Dimension "sticky" --
* if it is ever set (has a value), it will be always sent on subsequent beacons,
* even if the page doesn't set it.
*
* This plugin will utilize sessionStorage to do this.
*/
(function(w) {
//
// TODO: Configure which mPulse Dimension to make sticky
@nicjansma
nicjansma / boomerang-wait-after-onload-plugin.js
Last active April 21, 2024 13:21
The WaitAfterOnload Boomerang plugin waits for the specified number of seconds after * onload before a beacon is sent.
/**
* The `WaitAfterOnload` Boomerang plugin waits for the specified number of seconds after
* onload before a beacon is sent.
*
* It does not affect the Page Load time (`t_done`) -- it just delays a beacon
* for the specified number of seconds. This allows the beacon to contain additional
* ResourceTiming data and other metrics/timers that might happen after page load.
*
* NOTE: Any plugin like this that delays a beacon from being sent after onload
* will have an effect on total number of beacons captured (due to the visitor
@nicjansma
nicjansma / MountVHD.cmd
Created January 5, 2012 02:28
MountVHD and UnMountVHD: Allows you to mount .VHDs in Windows 7 from the command-line. http://nicj.net/2012/01/04/mounting-vhds-in-windows-7-from-a-command-line-script
@echo off
setlocal enabledelayedexpansion
if {%1}=={} (
echo Usage: %~nx0 [vhd] [letter]
exit /b 1
)
set vhdPath=%~dpnx1
set driveLetter=%2
@nicjansma
nicjansma / boomerang-disableunload-plugin.js
Created May 25, 2022 15:02
Boomerang DisableUnloadBeacon plugin
/**
* The Boomerang DisableUnloadBeacon plugin disables sending of the Unload beacon.
*
* The Unload beacon can be used to understand Session Duration (seconds on the page), but may not be needed in all cases.
*/
(function() {
window.BOOMR = window.BOOMR || {};
window.BOOMR.plugins = window.BOOMR.plugins || {};
window.BOOMR.plugins.DisableUnloadBeacon = {
@nicjansma
nicjansma / boomerang-cwv-plugin.js
Last active April 22, 2022 17:00
Boomerang CWV plugin that sends an additional Exit beacon before unload with FID (if it didn't happen by page load) and the SUM of CLS
/**
* The Boomerang CWV plugin assists in sending Core Web Vitals metrics First Input Delay (FID) and
* Cumulative Layout Shift (CLS) at the end of the page session. It does this by sending
* an additional "Page Exit" beacon prior to unload.
*
* The main changes in behavior over the EventTiming plugin (which sends FID) and Continuity
* plugin (which sends CLS) are:
*
* * If FID was _not_ on the Page Load beacon, this plugin sends FID on the Page Exit beacon.
* If FID was on the Page Load beacon, it is _not_ repeated on the Page Exit beacon.
@nicjansma
nicjansma / boomerang-waitformark-plugin.js
Last active April 20, 2022 13:21
Boomerang plugin that waits for the specified UserTiming Mark (or Measure) to exist on the page before a beacon is sent.
/**
* The `WaitForMark` Boomerang plugin waits for the specified UserTiming Mark
* (or Measure) to exist on the page before a beacon is sent.
*
* It does not affect the Page Load time (`t_done`) -- it just delays a beacon
* until the Mark exists. This allows the beacon to contain additional
* ResourceTiming data and other metrics/timers that might happen after page load.
*
* NOTE: Any plugin like this that delays a beacon from being sent after onload
* will have an effect on total number of beacons captured (due to the visitor
@nicjansma
nicjansma / boomerang-waitforjsvar-plugin.js
Last active April 20, 2022 13:20
Boomerang plugin that waits for the specified JavaScript variable to exist on the page before a beacon is sent.
/**
* The `WaitForJsVar` Boomerang plugin waits for the specified JavaScript variable
* to exist on the page before a beacon is sent.
*
* It does not affect the Page Load time (`t_done`) -- it just delays a beacon
* until the variable exists. This allows the beacon to contain additional
* ResourceTiming data and other metrics/timers that might happen after page load.
*
* NOTE: Any plugin like this that delays a beacon from being sent after onload
* will have an effect on total number of beacons captured (due to the visitor