Skip to content

Instantly share code, notes, and snippets.

@N-R-K
N-R-K / bench.c
Last active May 30, 2024 22:33
benchmarking utf8 decoders
// gcc -march=x86-64-v3 -O3 -o bench bench.c
// src taken from: https://github.com/skeeto/branchless-utf8/blob/master/test/benchmark.c
#define _POSIX_C_SOURCE 200112L
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <signal.h>
#include <stddef.h>
#include <unistd.h> // alarm()
@N-R-K
N-R-K / dwm_dmenu_color_gradient.patch
Last active March 26, 2022 09:48
dmenu/dwm patch: color gradient
From 94132cbde161398b51cded896aa5989d0a96e563 Mon Sep 17 00:00:00 2001
From: NRK <nrk@disroot.org>
Date: Sat, 26 Mar 2022 03:06:36 +0600
Subject: [PATCH] patch: add color gradient
this patch uses HSL color representation and changes the hue +1 for each
w pixel. probably not very efficient drawing things one column at a time.
caveat: assumes true-color X server which supports rgb colors.
---