Skip to content

Instantly share code, notes, and snippets.

View djanatyn's full-sized avatar

Jonathan Strickland djanatyn

View GitHub Profile
@djanatyn
djanatyn / llvm-bug.md
Created November 11, 2026 23:02
discovering a bug in LLVM's xtensa codegen for literal pool byte-alignment

motivation for encountering the LLVM bug

i have an embedded project that i worked on recently that renders baduk games to a ESP32-powered e-ink display:

it's a bit hacky, with a rust client to download the games, a bespoke data encoding, generated header files for getting data into flash memory, and a mostly-functional baduk game logic engine.

i've been searching for ways to write as little C++ as possible when working on embedded code. i think that zig is compatible with the C ABI, but not the C++ ABI. i know that zig can emit C!

i think it's possible to write zig code that uses C++ shims to call inkplate methods, compiling it to C code that is compatible with the arduino-cli compilation process. i was considering creating a wrapper shim in C++ for the C++ methods i use:

[
{
"name": "Osmumten's fang",
"price": {
"low": 19011776,
"high": 19112713
}
},
{
"name": "Amulet of fury",

Rust Atomic Spinlock Analysis

Overview

This analysis shows how Rust atomic operations with different memory orderings (Acquire, Release, Relaxed) translate through LLVM IR to actual ARM64 assembly instructions.

Key Findings

1. Lock Acquisition (Acquire Ordering)

Rust Source:

@djanatyn
djanatyn / provided-url-converter.js
Last active July 7, 2025 21:00
exploring proxycurl transition
function() {
var e = document.getElementById("tt-px-url").value,
l = document.getElementById("tt-el-url"),
t = e.replace("https://nubela.co/proxycurl/api", ""),
a = !1;
if (0 !== t.indexOf("/linkedin/school/students"))
for (var i = 0; i < o.length; i++) {
var c = o[i];
if (0 === t.indexOf(c)) {
t = t.replace(c, n[c]), "/linkedin/company/employees/count" === c && (t = t.replace("linkedin_employee_count", "estimated_employee_count")), a = !0;
@djanatyn
djanatyn / projects.hs
Created April 18, 2024 16:51
xmonad project configuration
-- https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Actions-DynamicProjects.html
myProjects :: [Project]
myProjects =
[ Project
{ projectName = "chat",
projectDirectory = "~/",
projectStartHook = Just $ spawn "Discord"
},
Project
{ projectName =
@djanatyn
djanatyn / disasm.rs
Created December 28, 2023 08:27
disassembling melee with radare2 from rust
use r2pipe::{R2Pipe, R2PipeSpawnOptions};
/// Filename of GALE01 v1.02 GCM disk image.
const SSBM_ISO: &str = "ssbm.iso";
/// Filename of converted main.dol -> main.elf, converted with doltool.
const MAIN_DOL: &str = "main.elf";
/// Offset of get_rand_int in main.elf and in memory.
///
@djanatyn
djanatyn / scrobble.md
Created October 18, 2023 00:34
scrobble fix story

when i'm biking i listen to music on my ipod (hacked to run rockbox), i like using last.fm so i record a scrobble.log file

i was going to upload the scrobbles but i noticed some of the dates were from before 2001

$ cat /mnt/.scrobbler.log
...
JPEGMAFIA EP2!  FEED HER! 6 176 L 1616925238     
Yuzo Koshiro  Actraiser Opening   131 S 946994845
...
@djanatyn
djanatyn / scrobble-fix.rs
Last active October 17, 2023 14:58
fixing scrobbles
//! https://github.com/Rockbox/rockbox/blob/3c89adbdbdd036baf313786b0694632c8e7e2bb3/apps/plugins/lastfm_scrobbler.c#L29
use chrono::{DateTime, TimeZone, Utc};
use nom::{
bytes::complete::take_until, character::complete::char, multi::count, sequence::terminated,
IResult,
};
fn main() -> std::io::Result<()> {
let log = std::fs::read_to_string("scrobbler.log")?;
@djanatyn
djanatyn / PlyPeach5K_Share_ACTION_AttackAirLw_figatree.subaction
Created July 1, 2023 15:08
PlyPeach5K_Share_ACTION_AttackAirLw_figatree
name: PlyPeach5K_Share_ACTION_AttackAirLw_figatree
stroff: 97c
animoff: 87f80
unknown 0x8: 3681
eventsoff: 55cc
positionalFlags: 8
charID: 900
unknown0x14: 0
48 (0x8d60):
offset: 0x55cc
@djanatyn
djanatyn / match.rs
Created November 26, 2022 15:45
ganzu
[src/main.rs:284] (filter, file) = (
Mimetype(
"text/plain",
),
FileSnapshot {
input_name: "/home/djanatyn/query.graphql",
absolute_path: "/home/djanatyn/query.graphql",
last_mtime: 1643587565,
mimetype: "text/plain",
},