Skip to content

Instantly share code, notes, and snippets.

View brianmichel's full-sized avatar
🎯
Focusing

Brian Michel brianmichel

🎯
Focusing
View GitHub Profile
# A simple proxy that matches the interface for a Swift Package Registry.
# make sure to `export GITHUB_TOKEN` in your environment and it should be a fine-grained token with:
# - `content:read` scope on the browser company organization.
#
# Then run `caddy run --config Caddyfile` to start the proxy.
{
# Enable extra diagnostics in logs
debug
}
@brianmichel
brianmichel / macos-iops-testing.sh
Last active August 22, 2025 20:24
Testing IOPS On macOS Machines
#!/bin/bash
TEST_DIR="/tmp/fio-test"
mkdir -p $TEST_DIR
# For macOS, use posixaio engine
ENGINE="posixaio"
echo "Testing with async I/O engine: $ENGINE"
# Sequential tests (these are already good)
#!/bin/bash
# Comprehensive Disk Benchmark Suite using Hyperfine
# Compares SSD, APFS RAM Disk, and HFS+ RAM Disk performance
set -e
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
@brianmichel
brianmichel / codex_beam_bootstrap.sh
Created June 16, 2025 01:59 — forked from DavidVII/codex_beam_bootstrap.sh
Installing Elixir/Erlang on Codex
# Setup Versions
ERLANG_VERSION=27.3.4
ELIXIR_VERSION=1.18.3
# Setup asdf
go install github.com/asdf-vm/asdf/cmd/[email protected]
asdf plugin add erlang https://github.com/michallepicki/asdf-erlang-prebuilt-ubuntu-24.04.git || true
asdf plugin add elixir
asdf install erlang $ERLANG_VERSION
@brianmichel
brianmichel / output.txt
Created March 2, 2024 16:21
Code that tries to reconstruct WritableKeyPaths from AnyKeyPath using _openExistential
Original WritableKeyPath is \MyFeatureFlags.fontOptions
Got specialization: CaseIterable
Reconstructed WritableKeyPath is \MyFeatureFlags.fontOptions
Got specialization: Base
@brianmichel
brianmichel / Test-HostConnectivity.ps1
Last active December 26, 2023 22:59
Test DNS resolution and SSL connectivity to a given host.
<#
.SYNOPSIS
Runs various networking tests to help debug connectivity issues to a specific host.
.PARAMETER Uri
The Uri that should be used as the remote host. This should be something like 'www.arc.net' which will be used
to test by DNS and SSL connectivity as needed.
.PARAMETER TestDns
Whether or not to test DNS resolution to the provided Uri
@brianmichel
brianmichel / chartd.swift
Created May 12, 2023 12:45
Generate a chartd chart with Swift
import Foundation
let b62 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
func encode(data: [Double], min: Double, max: Double) -> String {
let r = max - min
var bs = [Character](repeating: b62.first!, count: data.count)
if r == 0 {
for i in 0..<data.count {
bs[i] = b62.first!
@brianmichel
brianmichel / AudioTap.m
Last active February 19, 2023 20:36
Objective-C Audio Tap
#import "AudioTap.h"
@interface AudioTap ()
@property (nonatomic, nullable) AudioStreamBasicDescription const *audioDescription;
@property (nonatomic, nullable) MTAudioProcessingTapRef tapReference;
@property (nonatomic, weak) AVPlayer *audioPlayer;
@end
@implementation AudioTap
@brianmichel
brianmichel / goodbye.swift
Created December 16, 2022 23:46
Say goodbye to your meet tabs
#!/usr/bin/env swift
import AppKit
import Foundation
import ScriptingBridge
@objc public protocol SBObjectProtocol: NSObjectProtocol {
func get() -> Any!
}
@objc public protocol SBApplicationProtocol: SBObjectProtocol {
@brianmichel
brianmichel / weird-safari-animation.vue
Created November 6, 2022 15:04
A strange Safari animation
<template>
<div class="media-container" :style="dimensions">
<img :src="'/media/' + photo.name + '_preview.jpg'" />
</div>
</template>
<script lang="js">
import { defineComponent } from "vue";
export default defineComponent({