Skip to content

Instantly share code, notes, and snippets.

View algesten's full-sized avatar
πŸ˜€
barcelona!

Martin Algesten algesten

πŸ˜€
barcelona!
View GitHub Profile
@algesten
algesten / hardened-runtime-emoji-crash.md
Created March 2, 2026 09:28
macOS Hardened Runtime Required for CoreText Emoji Rendering

macOS Hardened Runtime Required for CoreText Emoji Rendering

Problem

On Apple Silicon Macs (ARM64), binaries signed without hardened runtime crash with SIGBUS (EXC_BAD_ACCESS / EXC_ARM_DA_ALIGN) when CoreText attempts to render bitmap emoji glyphs (sbix table). The crash occurs inside Apple's ImageIO framework:

IIOReadPlugin::callInitialize()

macOS Data Protection Keychain: Helper Binary Inside .app Bundle

Date: 2026-02-21

Environment

Component Version
macOS 15.6.1 (24G90)
Xcode 26.2 (17C52)
//! # Proposed API Changes for str0m
//!
//! Type-state pattern enforcing correct API usage at compile time.
//!
//! ## Core Principles
//!
//! 1. **Time is driven externally** β€” caller provides `now: Instant`
//! 2. **Every mutation requires poll-to-timeout** β€” type system enforces this
//! 3. **All state changes are mutations** β€” media writes, DirectApi, SDP
//!

Probe Clusters in str0m

This document outlines a plan for implementing probe clusters in str0m, matching libWebRTC's bandwidth probing approach.

Scope

This plan covers probe clusters for existing media RTX/padding only. Pre-media SSRC 0 probing is out of scope and will be addressed in a separate PR that builds on this infrastructure.

Current State

@algesten
algesten / blah.rs
Created August 7, 2022 13:22
Unhelpful tracing macro error
use tracing::{info_span, Span};
pub struct Blah {
pub span: Span,
}
impl Blah {
pub fn new(name: &str) -> Self {
Blah {
span: info_span!(name),
stokast v0.1.0 (/Users/martin/dev/stokast)
β”œβ”€β”€ alg v0.1.0 (/Users/martin/dev/alg)
β”‚ β”œβ”€β”€ gcd v2.0.1
β”‚ └── log v0.4.14
β”‚ └── cfg-if v1.0.0
β”œβ”€β”€ arrayvec v0.7.1
β”œβ”€β”€ cortex-m v0.6.7
β”‚ β”œβ”€β”€ aligned v0.3.5
β”‚ β”‚ └── as-slice v0.1.5
β”‚ β”‚ β”œβ”€β”€ generic-array v0.12.4
@algesten
algesten / aws.rs
Last active June 1, 2021 09:00
ureq aws sign
use chrono::{DateTime, Utc};
use hmac::{Hmac, Mac, NewMac};
use once_cell::sync::Lazy;
// notice this is percent_encoding=1.0.1 since I haven't bothered to
// fix this for latter versions of the crate.
use percent_encoding::{define_encode_set, utf8_percent_encode, SIMPLE_ENCODE_SET};
use sha2::{Digest, Sha256};
use std::env;
use std::fmt::Write;
@algesten
algesten / README.md
Last active April 10, 2018 12:17
Investigate CTFontCopyDefaultCascadeListForLanguages

Apple provides CTFontCopyDefaultCascadeListForLanguages to get a set of fallback font names for a certain ISO language code. I want to know how much these vary.

main.swift is a quick hack to dump a JSON of all codes with the fallbacks. The test assumes Menlo 12.0 as the starting point.

output.json is the full output from running the swift hack.

Finally I used nodejs to crunch the json to buckets that have different lists of fallbacks. code is in crunch.js

buckets.json has the result of running the crunch.

@algesten
algesten / tmux.conf
Created May 14, 2017 08:30
A tmux.conf with pbcopy
# propagate titles to the window
set -g set-titles on
# Minimalist window title "0:bash"
set -g set-titles-string "#I:#W"
# show colors
set -g default-terminal "screen-256color"
@algesten
algesten / start-tmux.sh
Created May 14, 2017 07:59
start tmux in bashrc
# TMUX
# test if tmux is available
if type tmux >/dev/null 2>&1; then
# if not inside a tmux session, and if no session is started, start a new session
# I only want this on my mac laptop.
if [ -z "$TMUX" -a `uname` == Darwin ]; then
# attach to session "martin" if there
exec tmux -2 -f ~/.tmux-osx.conf new-session -A -s martin
fi
fi