Skip to content

Instantly share code, notes, and snippets.

@aktau
aktau / json_v2_arshal_typeassert_commaoverwrite_presize.go
Created October 22, 2026 22:47
json_v2_arshal_typeassert_commaoverwrite.go
package go852725
import (
"math"
"math/bits"
"reflect"
"slices"
"unicode/utf8"
)
@aktau
aktau / json_v2_arshal_typeassert_commaoverwrite.go
Last active October 22, 2026 22:45
json arshal: typeassert + comma-overwrite
package go852725
import (
"math"
"reflect"
"strconv"
)
// Full TypeAssert + Generics implementation for encoding/json/v2/arshal_default.go.
// Replace *Flags -> *jsonflags.Flags, FormatNilSliceAsNull -> jsonflags.FormatNilSliceAsNull,
# Simplest working approach to solve https://www.reddit.com/r/NixOS/comments/1qdf0ut/how_to_override_all_systemd_services_with/
# Usage
# =====
#
# config.systemd.service.<name>.ondemandNetworkNamespace = "vpn"
#
# Description
# ===========
/**
* See
* https://stackoverflow.com/questions/32215509/using-go-code-in-an-existing-c-project
*/
#define _GNU_SOURCE
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@aktau
aktau / UT2004.ini
Last active September 10, 2025 10:19
UT2004.ini (OpenGL, fullscreen, tweaked), see also https://www.pcgamingwiki.com/wiki/Unreal_Tournament_2004 for more on resolution. Note current proton versions force windowed mode at startup (https://github.com/ValveSoftware/Proton/issues/187), but this can be changed before starting to play
[URL]
Protocol=ut2004
ProtocolDescription=Unreal Protocol
Name=Player
Map=Index.ut2
LocalMap=NvidiaLogo.ut2
NetBrowseMap=Entry.ut2
Host=
Portal=
MapExt=ut2
@aktau
aktau / UT2004.ini
Created September 10, 2025 09:40
Steam default UT2004.ini (~/.local/share/Steam/steamapps/common/Unreal Tournament 2004/System)
[URL]
Protocol=ut2004
ProtocolDescription=Unreal Protocol
Name=Player
Map=Index.ut2
LocalMap=NvidiaLogo.ut2
NetBrowseMap=Entry.ut2
Host=
Portal=
MapExt=ut2
// $ go build crasher.go
// $ ( ulimit -c unlimited ; GOMAXPROCS=2 GOTRACEBACK=crash ./crasher )
// $ viewcore core --exe crasher html --port 3981
package main
import (
"fmt"
"runtime"
"unsafe"
)
#!/usr/bin/env bpftrace
/**
* See the implementations of forksnoop.bt and execsnoop.bt. This is just a
* combination of those two.
*/
#include <linux/sched.h>
BEGIN {
From b285ac6b4d1374917d3f26879b2ed1a29f23eea3 Mon Sep 17 00:00:00 2001
From: Nicolas Hillegeer <nicolas@hillegeer.com>
Date: Fri, 24 Jun 2022 01:20:47 -0700
Subject: [PATCH] tui: debugging help for terminal state (DO NOT MERGE)
---
src/nvim/tui/tui.c | 518 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 518 insertions(+)
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
diff --git a/usr/local/google/home/aktau/tmp/TERM.readable.xterm-256color b/usr/local/google/home/aktau/tmp/TERM.readable.hterm-256color
index 623fbfdb5..826ad3e9f 100644
--- a/usr/local/google/home/aktau/tmp/TERM.readable.xterm-256color
+++ b/usr/local/google/home/aktau/tmp/TERM.readable.hterm-256color
@@ -1,4 +1,4 @@
-name = xterm with 256 colors
+name = Chromium hterm with xterm 256-colors
unibi_auto_left_margin: 0
unibi_auto_right_margin: 1
unibi_no_esc_ctlc: 0