Skip to content

Instantly share code, notes, and snippets.

@jwhear
jwhear / XB270HU.md
Created October 30, 2025 04:34
Getting an Acer XB270HU monitor working with my new Framework Desktop

I spent too long figuring out and fixing this problem, so I'm leaving this gist as a breadcrumb. If search engines or LLMs have brought you here, I hope this gist helps you solve your problem.

I've had a XB270HU for years and it's still a great monitor. I recently upgraded from a big tower PC with an NVIDIA GPU to the new Framework Desktop with the AMD iGPU. Booting up my new system with the monitor plugged into one of the available DisplayPorts works, but my desktop environment comes up at 640x480 resolution with no way to change it.

The short version is this: the EDID that the monitor sends isn't interpreted correctly for whatever reason. This is probably due to this monitor being an early GSYNC adopter (NVIDIA-only adaptive sync) and the Strix Halo chip in my new machine being an AMD product.

@jwhear
jwhear / build.zig
Created February 20, 2023 21:51
No unistd.h for macos 10
const std = @import("std");
const CrossTarget = std.zig.CrossTarget;
pub fn build(b: *std.Build) void {
const target = CrossTarget{
.cpu_arch = .x86_64,
.os_tag = .macos,
.os_version_min = CrossTarget.OsVersion{ .semver = .{ .major = 10, .minor = 14, .patch = 0 } },
.abi = .none,
};

Here's a "fun" challenge for Zig's comptime design. I have implemented the Adaptive Radix Tree and am now looking to generalize it. To save you from having to read the whole paper, it's a radix tree but inner nodes can be one of several types in an attempt to reduce node size and corresponding memory cache issues. My Zig implementation of the paper works fine, but I want to generalize so that, for instance, when using smaller key types, the types of the inner nodes can be changed. For instance, if using []const u5, a fully dense node has only 32 children so the Node48 type doesn't make sense.

Here's a sketch of what the ART types look like with various details elided:

pub const Key = []const u8;
pub const KeySegment = u8;
pub const Payload = usize;
pub const KeySpace = std.math.maxInt(KeySegment) + 1;
@jwhear
jwhear / Dockerfile.debian
Created July 28, 2022 14:33
LiteFS docker test (Debian)
FROM debian
RUN apt update && apt install -y fuse3 libfuse3-dev sqlite3 wget zip
RUN wget https://releases.hashicorp.com/consul/1.12.3/consul_1.12.3_linux_amd64.zip &&\
unzip consul_1.12.3_linux_amd64.zip &&\
mv consul /usr/bin/
# Get LiteFS
RUN wget https://github.com/superfly/litefs/releases/download/v0.1.0/litefs-v0.1.0-linux-amd64.tar.gz -O - | tar -xzf -
@jwhear
jwhear / Dockerfile.fedora
Created July 28, 2022 14:09
LiteFS Dockerfile test (Fedora)
FROM fedora
RUN dnf install -y kmod fuse3 fuse3-libs fuse3-devel wget sqlite
RUN dnf install -y dnf-plugins-core && \
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo && \
dnf -y install consul
#RUN modprobe fuse
# Get LiteFS
RUN wget https://github.com/superfly/litefs/releases/download/v0.1.0/litefs-v0.1.0-linux-amd64.tar.gz -O - | tar -xzf -
@jwhear
jwhear / Dockerfile.alpine
Last active July 28, 2022 14:08
LiteFS Dockerfile test
FROM alpine
RUN apk add fuse3 wget sqlite consul
# Get LiteFS
RUN wget https://github.com/superfly/litefs/releases/download/v0.1.0/litefs-v0.1.0-linux-amd64.tar.gz -O - | tar -xzf -
# Copy the repro script
COPY repro.sh .
@jwhear
jwhear / valgrind_gc.supp
Created August 14, 2019 23:00
Valgrind suppression D GC "leaks"
{
GC1
Memcheck:Cond
fun:_D2gc*
}
{
GC2
Memcheck:Value4
fun:_D2gc2gc*
}
@jwhear
jwhear / buffer.d
Created November 16, 2012 19:59
Derelict3 + GLFW3 Example
module buffer;
import derelict.opengl3.gl3;
class VertexArray
{
GLuint vao;
alias vao this;
this()
@jwhear
jwhear / bpbinstream1.js
Created January 12, 2012 20:51
JS Binary stream p1
Endianness = {
Little: 0,
Big: 1
};
BinaryStream = function(source){
this.source = source;
this.cursor = 0;
this.byteOrder = Endianness.Little;