Skip to content

Instantly share code, notes, and snippets.

View billywhizz's full-sized avatar
🤓
always be learning

Andrew Johnston billywhizz

🤓
always be learning
View GitHub Profile
@billywhizz
billywhizz / base model trends.md
Created July 2, 2025 20:48 — forked from rain-1/base model trends.md
base model trends.md
@billywhizz
billywhizz / rdiff-example.sh
Created June 21, 2025 00:10 — forked from jpillora/rdiff-example.sh
rdiff file example
# $ apt install rdiff
# $ rdiff --help
# Usage: rdiff [OPTIONS] signature [BASIS [SIGNATURE]]
# [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]]
# [OPTIONS] patch BASIS [DELTA [NEWFILE]]
# Options:
# -v, --verbose Trace internal processing
# -V, --version Show program version
# -?, --help Show this help message
import { Stats } from './lib/bench.js'
import { SQL } from "bun";
const pool_size = 4
/*
CREATE TABLE Test (
id integer NOT NULL,
PRIMARY KEY (id)
);
@billywhizz
billywhizz / padding.js
Created May 30, 2025 23:49 — forked from clochix/padding.js
JavaScript padding tolerant to ANSI escape sequences
/**
* Display a string with padding
*
* @param {String} str String to pad
* @param {Integer} l padding length
* @param {Boolean} [r] true for right padding
*
* @return {String}
*/
function pad(str, l, r) {
@billywhizz
billywhizz / sve2.md
Created May 17, 2025 21:36 — forked from zingaburga/sve2.md
ARM’s Scalable Vector Extensions: A Critical Look at SVE2 For Integer Workloads

ARM’s Scalable Vector Extensions: A Critical Look at SVE2 For Integer Workloads

Scalable Vector Extensions (SVE) is ARM’s latest SIMD extension to their instruction set, which was announced back in 2016. A follow-up SVE2 extension was announced in 2019, designed to incorporate all functionality from ARM’s current primary SIMD extension, NEON (aka ASIMD).

Despite being announced 5 years ago, there is currently no generally available CPU which supports any form of SVE (which excludes the [Fugaku supercomputer](https://www.fujitsu.com/global/about/innovation/

@billywhizz
billywhizz / 1_Hello_libtls
Created May 6, 2025 23:23 — forked from kinichiro/1_Hello_libtls
Hello libtls - libressl libtls API sample program
Hello libtls - libressl libtls API sample program
@billywhizz
billywhizz / Makefile
Created April 19, 2025 23:13 — forked from alifarazz/Makefile
A Linux process cloning example using Clone().
all: default
default: waitpid waitpid_optimized
waitpid: waitpid.c Makefile
$(CC) -Wall -Werror -std=gnu17 -ggdb -o waitpid waitpid.c
waitpid_optimized: waitpid.c Makefile
$(CC) -Wall -Werror -std=gnu17 -Ofast -o waitpid_optimized waitpid.c
@billywhizz
billywhizz / main.c
Created March 29, 2025 20:32 — forked from mattiasgustavsson/main.c
Minimal code example for creating a window to plot pixels to
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <windows.h>
#pragma comment( lib, "user32.lib" )
#pragma comment( lib, "gdi32.lib" )
#define SCRW 640
#define SCRH 480
@billywhizz
billywhizz / xcb_shmimg.c
Created March 29, 2025 20:31 — forked from datenwolf/xcb_shmimg.c
minimal example of using XCB to set up a framebuffer to draw to an X11 window
#include <stdlib.h>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <xcb/xcb.h>
#include <xcb/shm.h>
#include <xcb/xcb_image.h>
@billywhizz
billywhizz / jq.md
Created March 19, 2025 00:20 — forked from jwbee/jq.md
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is