Skip to content

Instantly share code, notes, and snippets.

Avatar
😸
Herding cats

Stephen Gutekanst slimsag

😸
Herding cats
View GitHub Profile
@slimsag
slimsag / ramblings.md
Last active June 6, 2023 09:06
Because cross-compiling binaries for Windows is easier than building natively
View ramblings.md

Because cross-compiling binaries for Windows is easier than building natively

I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.

The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.

The source of truth for the 'open source' C#, C++, Rust, and other Windows SDKs is proprietary

You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.

View gist:a55c0f6d715a8ab10e77b9b565e5ccc3
CREATE SCHEMA partman;
CREATE EXTENSION pg_partman SCHEMA partman;
CREATE ROLE partman WITH LOGIN;
GRANT ALL ON SCHEMA partman TO partman;
GRANT ALL ON ALL TABLES IN SCHEMA partman TO partman;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA partman TO partman;
GRANT EXECUTE ON ALL PROCEDURES IN SCHEMA partman TO partman; -- PG11+ only
GRANT ALL ON SCHEMA my_partition_schema TO partman;
GRANT TEMPORARY ON DATABASE sg to partman; -- allow creation of temp tables to move data out of default
View parser.zig
const std = @import("std");
const Allocator = std.mem.Allocator;
pub const Error = error{
EndOfStream,
Utf8InvalidStartByte,
} || std.fs.File.ReadError || std.fs.File.SeekError || std.mem.Allocator.Error;
pub fn Parser(comptime Value: type, comptime Reader: type) type {
return struct {
View macos.txt
macOS frame rate of a simple triangle example
starts with vsync enabled and then disabled vsync (printed).
The FPS is printed once every 0.25s
FPS: 60
FPS: 60
FPS: 59
FPS: 61
FPS: 60
@slimsag
slimsag / ports--libyuv--fix_cmakelists.patch
Created December 20, 2022 06:19
vcpkg libyuv arm64 patch
View ports--libyuv--fix_cmakelists.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed4948f..5b4e112 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,10 +3,15 @@
# Originally created for "roxlu build system" to compile libyuv on windows
# Run with -DTEST=ON to build unit tests
 
-PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
@slimsag
slimsag / README.md
Last active December 6, 2022 20:59
k3d start Sourcegraph+helm cluster
View README.md

If existing already, delete the default k3d cluster:

k3d cluster delete

Start a k3d cluster and port forward the loadbalancer:

k3d cluster create -p "30080:80@loadbalancer"
@slimsag
slimsag / README.md
Created December 6, 2022 01:31
k3d start sourcegraph cluster
View README.md

If existing already, delete the default k3d cluster:

k3d cluster delete

Start a k3d cluster and port forward the loadbalancer:

k3d cluster create -p "30080:80@loadbalancer"
@slimsag
slimsag / README.md
Created December 2, 2022 06:17
mini server
View README.md
OS Arch Model CPU RAM Storage
macOS arm64 2020 Mac Mini Apple Silicon M1 8 core 3.2ghz 8GB 512G SSD
macOS x86 Late 2014 Mac Mini Intel i7 8 core 3ghz 16GB 256G SSD
linux x86 Beelink GTR5 5900HX Ryzen 9 5900HX 8 core 4.6ghz 32GB 512G SSD
windows x86 Beelink GTR5 5900HX Ryzen 9 5900HX 8 core 4.6ghz 32GB 512G SSD
windows arm64 Windows Dev Kit 2023 Snapdragon 8cx Gen 3, 8 core ~3ghz 32GB 512G SSD
linux arm64 Radxa ROCK pi 5B RK3588 8 core ~2.4ghz 16G 512G SSD
  • Case: KENUCO SOHO Mini 10" Rack
@slimsag
slimsag / README.md
Last active September 18, 2022 17:48
Proprietary mesh triangulation in open source software
View README.md

Proprietary mesh triangulation in open source software?

Recently I was looking for a solid, reliable way to do path triangulation. Looking at state-of-the-art research, I came across the UC Berkley researcher Jonathan Shewchuk's outstanding Triangle library.

Jonathan is very clear on the Triangle website, and in source code, about the project not being open-source:

This program may be freely redistributed under the condition that the copyright notices (including this entire header and the copyright notice printed when the `-h' switch is selected) are not removed, and no compensation is received. Private, research, and institutional use is free.

View main.zig
const std = @import("std");
const builtin = @import("builtin");
const testing = std.testing;
const process = std.process;
const fs = std.fs;
const ChildProcess = std.ChildProcess;
var a: *std.mem.Allocator = undefined;
pub fn main() !void {