Skip to content

Instantly share code, notes, and snippets.

@benglewis
benglewis / gist:912ff09994ec452efc1d1287dea518d9
Created August 9, 2026 13:39
Why the spec PDF search lands on the wrong page.mhtml
From: <Saved by Blink>
Snapshot-Content-Location: https://claude.ai/code/artifact/b960d3b0-e3ee-41d4-aaaf-008bd295cd15?open_in_browser=1&via=user_open&org=b1115f54-04d8-40a8-a2cb-bea6cd7a2255
Subject: Why the spec PDF search lands on the wrong page
Date: Sun, 9 Aug 2026 16:37:48 +0300
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----MultipartBoundary--MrHHygFPIxOijrTfdmtvfVNjCzhnJRXUwRXKPFWD7W----"
@benglewis
benglewis / Pixi-alpine.Dockerfile
Last active May 22, 2024 09:58
Use `woahbase/alpine-glibc` for `pixi`
FROM --platform=$TARGETPLATFORM woahbase/alpine-glibc
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && apk update && apk add pixi@testing
@benglewis
benglewis / Pixi-alpine.Dockerfile
Created May 20, 2024 13:08
An Alpine based Dockerfile for Pixi
ARG PIXI_VERSION=0.22.0
ARG BASE_IMAGE=frolvlad/alpine-glibc:alpine-3.19
ARG PIXI_USER=pixi
FROM --platform=linux/amd64 $BASE_IMAGE AS builder
ARG PIXI_VERSION
RUN apk update && apk add --no-cache curl
RUN curl -Ls \
"https://github.com/prefix-dev/pixi/releases/download/v${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl" \
-o /pixi && chmod +x /pixi
@benglewis
benglewis / frameRateMonitor.js
Created November 8, 2021 23:32
Cesium frameRateMonitor
const viewer = new Cesium.Viewer("cesiumContainer");
const frameRateMonitor = new Cesium.FrameRateMonitor({
scene: viewer.scene,
minimumFrameRateDuringWarmup: 100,
minimumFrameRateAfterWarmup: 200
});
frameRateMonitor.lowFrameRate.addEventListener((scene, lowFrameRate) => console.warn('Low frame rate!', frameRateMonitor, lowFrameRate));
@benglewis
benglewis / symbol_performance_improvements.rb
Created May 3, 2017 22:28
Ruby BSON symbol performance improvements
require 'benchmark/ips'
unless ((defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') || RUBY_VERSION < "2.1")
require 'memory_profiler'
end
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
require 'bson'
var newDiv = document.createElement("div");
var newContent = document.createTextNode("Hi there and greetings!");
newDiv.style.textAlign = "center";
newDiv.style.position = "absolute";
newDiv.style.height = "50px";
newDiv.style.width = "500px";
newDiv.style.top = "50%";
newDiv.style.left = "50%";
newDiv.style.marginTop = "-25px";
newDiv.style.marginLeft = "-250px";
import nltk
string = '''
I hate waiting in hospitals
Car parking is very expensive
I keep hearing your voice
Someone bought chocoolate and didn't give me any
The sound of Rosie's voice makes me want to cry
Kevin has stopped laughing because he lost his voice
The water is too wet