Skip to content

Instantly share code, notes, and snippets.

View STRML's full-sized avatar

Samuel Reed STRML

View GitHub Profile
// @flow
const crypto = require('crypto');
module.exports = WebpackStableChunkHash;
function WebpackStableChunkHash() {}
WebpackStableChunkHash.prototype.apply = function(compiler) {
//
// For a while, webpack has had issues with [chunkhash] being unstable and not reflecting the actual
@STRML
STRML / ResizeSensor.js
Created April 21, 2018 03:49
A resize sensor component for React that doesn't use iframes, objects, or require ResizeObservers.
// @flow
import * as React from 'react';
type Dimensions = {width: number, height: number, ref: ?HTMLElement};
type Props = {
children?: React.Node,
className?: string,
onResize: (dimensions: Dimensions) => any,
};
@STRML
STRML / bat-download.js
Last active December 5, 2025 21:01
A simple script for downloading all images for a listing on BringATrailer.com
(async function() {
const delay = (ms) => new Promise(r => setTimeout(r, ms));
// Given a url, try to download a high-res version of it
// This prevents us from downloading a downscaled thumbnail
function replaceUrlParam(url) {
return url
.split('?')[0] // get rid of querystring
.replace('-scaled.', '.'); // Remove `-scaled` to attempt to get the full res image
}
@STRML
STRML / zha-lutron-aurora-smart-area-blueprint.yaml
Last active October 12, 2024 22:18 — forked from blizzrdof77/zha-lutron-aurora-smart-area-blueprint.yaml
HASS Blueprint | ZHA - Lutron Aurora Smart Area with Night-Light Dimmer
blueprint:
name: ZHA - Lutron Aurora Dimmer Expanded v1.5
description: Control lights with a Lutron Aurora Dimmer Pressing in the dimmer button will toggle between turning lights on to full brightness, and turning the lights off. Rotating the dimmer will increase and decrease the light brightness. Adjust the sensitivity if updates from the dimmer are being sent too quickly.
domain: automation
input:
remote:
name: Lutron Aurora Dimmer Switch
description: Lutron Aurora Z3-1BRL
selector:
device:
@STRML
STRML / MEMORY-SYSTEM-SPEC.md
Last active February 22, 2026 17:02
Claude Memory Spec

Claude Code Persistent Memory System — Spec

Note: This is the canonical spec. All scripts are embedded here with their full content. When editing scripts, update this spec to include the complete file content — no stubs or references to external files.

A two-layer memory system for Claude Code that compounds knowledge across sessions. Primary mechanism is proactive in-session note-taking (via CLAUDE.md instructions). Safety net is a Stop hook that spawns background Sonnet (medium effort) to extract missed learnings from transcripts. Periodic Opus (low effort) GC prevents unbounded growth. On /clear, a fast Sonnet (low effort) pass captures learnings before context is discarded.

Architecture