Skip to content

Instantly share code, notes, and snippets.

@mindplay-dk
mindplay-dk / clean-google.txt
Last active September 26, 2025 04:16
"Clean Google" ad blocking content filter (for Brave, uBlock origin, etc.)
# Block everything in search results except actual results & videos:
www.google.com###search div>div[data-rpos]:not(:has([data-snf])):not(:has([data-vurl])):not(:has(h3>a.l)):not(:has([jscontroller]):has([data-maindata*="currency"]))
# AI overview:
www.google.com##[data-mcpr]
# Junk below search results:
www.google.com###bres
# Junk in right-hand column:
@mindplay-dk
mindplay-dk / figma-dpx-bug.md
Created September 18, 2025 09:44
Figma scaling issue (Windows, display scale, DPI, device pixels)

This issue has been bothering me since I started using Figma a few years ago:

The rendered px units in Figma are about 8% smaller than they are in Chromium-based browsers.

In other words, when developers copy px values from Figma and implement them on the web, the rendered results are around 10% larger than the design.

This is a really serious issue, especially when selecting very small font sizes - for example, there is a considerable difference when a font is rendered at 10px, 11px and 12px, and designers are very careful when selecting small font sizes.

And just in general, you design for a specific experience, especially when creating fluid web page designs - a 10% difference is a huge perceived difference on a large page, and it just gives the design a different feel and experience versus what you actually designed.

@mindplay-dk
mindplay-dk / README.md
Last active September 3, 2025 10:34
GNOME extension settings (Ubuntu)

These are my GNOME extension settings to make the Ubuntu desktop work mostly like Windows 8/10 used to work:

  • Bottom taskbar - Shows running applications with window previews (Dash to Panel)
  • Start menu - Traditional hierarchical application launcher accessed via menu button (ArcMenu)
  • Window snapping - Snap windows to predefined layouts by holding CTRL (Tiling Shell)
  • Emoji picker - Quick emoji insertion panel similar to Windows: WIN + . (Emoji Copy)
  • Desktop icons - I've turned them off because my Desktop is always a mess - save things in Documents instead.
  • Taskbar window previews - I've turned them off because they're annoying.
  • Application indicators - I've removed them because they're distracting.
@mindplay-dk
mindplay-dk / bnf.md
Created August 16, 2024 09:33
Making sense of BNF, ABNF, EBNF syntax differences and history

Claude.ai just helped me make a whole lot more sense of the absolute mess that is BNF-family syntaxes. 🤔

I just discovered ABNF is actually a standard, RFC 4234.

Why isn't this more widely used?

BNF in the wild drives me nuts - no two grammars are ever written in the same flavor of BNF, and often grammars are published as merely "BFN" neglecting to even specify which BNF variant was used.

Are there any other BNF variants that are properly standardized?

@mindplay-dk
mindplay-dk / tak-rules.md
Last active August 6, 2025 10:02
Concise Tak Rules

Tak Rules

1. Starting Play

1.1. Board Setup

  • The board must be square: standard sizes are 3×3, 4×4, 5×5, 6×6, 7x7, or 8×8.
  • The board starts empty.
  • Players each have a supply of stones and capstones based on board size:
@mindplay-dk
mindplay-dk / join.sh
Created June 27, 2025 07:24 — forked from detunized/join.sh
Join repos into subfolders with flat history
#!/bin/bash
set -euo pipefail
$REPO_DIR=~/devel
repos="1password bitwarden dashlane lastpass opvault passwordbox roboform stickypassword truekey zoho-vault"
# pull all repos
(
for repo in $repos; do
echo $repo
@mindplay-dk
mindplay-dk / translation.ts
Last active May 13, 2025 06:50
Type-safe language translations in TypeScript
const DANISH = {
"Hello {{name}}!": "Hej {{name}}",
"Welcome to the world": "Velkommen til Verden",
"You have {{amount}} {{cookies}}": "Du har {{amount}} {{cookies}}",
"cookie": "kage",
"cookies": "kager",
"Missing translation": "Manglende oversættelse",
}
type TranslationKey = keyof typeof DANISH
@mindplay-dk
mindplay-dk / waitForElement.js
Last active April 29, 2025 22:34
waitForElement function (wait for element matching selector)
let animationCounter = 0;
export function waitForElement(selector) {
return new Promise((resolve) => {
const elem = document.querySelector(selector);
if (elem) {
resolve(elem); // already in the DOM
}
@mindplay-dk
mindplay-dk / frameworks.md
Created March 30, 2025 07:32
DeepSeek really doesn't like React

between the most popular frontend frameworks (React, Svelte and Solid in particular) what are the features a modern frontend framework must have to be considered a serious option? focus on frontend frameworks with fine grained reactivity. ignore features like server side rendering and server components and focus on frontend features. identify features and requirements that are handled differently in each framework and focus on the problems they solve.

To be considered a serious modern frontend framework with fine-grained reactivity, the following features and capabilities are essential. These features address core challenges like efficient DOM updates, state synchronization, and developer ergonomics. Below is a breakdown of these requirements and how React, Svelte, and Solid handle them differently:


1. Fine-Grained Reactivity System

A framework must track dependencies at the most granular level (e.g., individual variables or DOM nodes) to update only what changes, avoiding

@mindplay-dk
mindplay-dk / ubuntu.md
Last active February 18, 2025 08:08
Ubuntu on Windows

Introduction

⚠️ I am no longer actively maintaining this. ⚠️

With the Windows 10 Creators Update comes an awesome new opportunity to run a lighweight Ubuntu Linux environment as a subsystem of Windows. This is officially known as Windows Subsystem for Linux (WSL) or Bash on Windows.

This is great news for PHP developers using Windows - we can now get access to native Linux builds of PHP, PECL extensions, ImageMagick, NGINX and other server components and tools, without having to migrate to a Linux desktop environment!

In this guide, we'll get you set up with WSL itself, a working PHP 8.2 environment with OpCache, XDebug and task/terminal integration with Php Storm, and working NGINX configuration - as well as various tools, including PEAR/PECL, Composer and Node.JS.