Skip to content

Instantly share code, notes, and snippets.

@davidar
davidar / qt-flatpak-dark-mode-gnome.md
Created February 15, 2026 06:47
Qt Flatpak apps don't detect dark mode on GNOME — root cause analysis and workaround

Qt Flatpak Apps Don't Detect Dark Mode on GNOME

TL;DR: Qt6 Flatpak apps using the KDE runtime ignore GNOME's dark mode preference. The workaround is three environment variables + Kvantum.

The Problem

If you run Qt/KDE Flatpak apps (qBittorrent, OBS Studio, VLC, etc.) on GNOME with dark mode enabled, they render with a light theme — white backgrounds, light widgets, the works.

This is caused by two bugs in the Qt/KDE stack.

@davidar
davidar / enable-webgpu-flatpak-chrome.md
Created December 28, 2025 12:55
Enable WebGPU on Flatpak Chrome (Linux)

Enable WebGPU on Flatpak Chrome (Linux)

WebGPU isn't enabled by default on Linux Chrome. Here's how to enable it for Flatpak Chrome.

Quick Setup

Create the config file at ~/.var/app/com.google.Chrome/config/chrome-flags.conf with these contents:

--enable-unsafe-webgpu
@davidar
davidar / fix-claude-code-flatpak-chrome.md
Created December 28, 2025 12:31
Fix Claude Code Chrome extension with Flatpak Chrome (Fedora Silverblue, etc.)

Fix Claude Code Chrome Extension with Flatpak Chrome

If you're using Chrome installed via Flatpak (common on Fedora Silverblue, immutable distros, etc.), the Claude Code browser automation won't work out of the box. Here's how to fix it.

The Problem

Claude Code installs the native messaging host to the standard Chrome location, but Flatpak Chrome:

  1. Looks for native messaging hosts in a different directory
  2. Has a sandboxed /tmp that isolates the Unix socket used for communication
  3. Doesn't have access to ~/.claude/ or ~/.local/share/claude/ by default
# Base model configuration
base_model: mistralai/Mistral-Small-24B-Base-2501
model_type: MistralForCausalLM
tokenizer_type: AutoTokenizer
trust_remote_code: true
tokenizer_use_fast: true
# Device settings - simpler approach for multi-GPU
# Use balanced loading with 4-bit quantization
device_map: "balanced"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
Polykite Tiling Explorer
Author: OpenAI GPT-4
Description:
This script explores the tiling properties of polykites, specifically those with 8 components.
It generates all possible polykites with 8 components, canonicalizes them to avoid duplicate
analysis, and then computes their isohedral numbers to identify interesting candidates for further
mathematical exploration.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* Partial port of PBRT v3 <https://github.com/mmp/pbrt-v3> to WGSL.
BSD 2-Clause License
Copyright (c) 1998-2015, Matt Pharr, Greg Humphreys, and Wenzel Jakob
Copyright (c) 2022, David A Roberts <https://davidar.io/>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
fn pcg_random(seed: ptr<function, uint>) -> float {
*seed = *seed * 747796405u + 2891336453u;
let word = ((*seed >> ((*seed >> 28u) + 4u)) ^ *seed) * 277803737u;
return float((word >> 22u) ^ word) / float(0xffffffffu);
}
// weighted coin flip (bernoulli)
fn flip(state: ptr<function, uint>, p: float) -> bool {
return pcg_random(state) <= p;
}
fn isfinite(x: f32) -> bool {
return clamp(x, -3.4e38, 3.4e38) == x;
}
fn hash12(p: float2) -> float {
var p3 = fract(float3(p.xyx) * .1031);
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.x + p3.y) * p3.z);
}