Skip to content

Instantly share code, notes, and snippets.

View brennanMKE's full-sized avatar

Brennan Stehling brennanMKE

View GitHub Profile
@brennanMKE
brennanMKE / DebuggingLeaksWithLLDB.md
Last active May 27, 2025 18:25
Debugging with LLDB

✅ Debugging Memory Leaks with LLDB

🔍 1. Inspect What Is at a Given Memory Address

Yes — if you have a memory address from a leak report, LLDB can tell you what object it points to:

memory read --format x --size 8 --count 1 0xADDRESS
@brennanMKE
brennanMKE / AccessModel.md
Last active May 9, 2025 19:18
Sponsor Access Standard

🔧 Sponsor Access Protocol – Revised Access Model

✅ Overview

Each sponsor token grants access rights based on a defined access type, including:

Access Type Description
timed Fixed expiration (e.g., 7 days from claim)
day_pass Each use activates 24-hour access; multiple passes can be held
@brennanMKE
brennanMKE / README.md
Created April 5, 2025 08:13
Swift Study Notes

✅ Swift 6 Study Notes — any, some, Existentials, Boxing, Dispatch

(via ChatGPT)

🧱 any vs some — Existential vs Opaque Types

any Protocol

  • Existential type: Can hold a value of any type that conforms to the protocol.
  • Requires heap allocation (boxing).
  • Uses dynamic dispatch via a witness table.
@brennanMKE
brennanMKE / README.md
Created April 4, 2025 20:26
Tailscale and WireGuard

Tailscale and WireGuard

(via ChatGPT)

🔧 Overview: Platform Features Supporting WireGuard & Tailscale

Modern OSes like macOS, Linux, Windows, and iOS have built-in support for networking features that make tools like WireGuard and Tailscale work smoothly:

💡 Core Platform Features Used

| Feature | Description | Used By |

@brennanMKE
brennanMKE / README.md
Created March 28, 2025 22:47
Swift with sending parameter

What sending enforces

Using sending tells the compiler:

  • This value will be consumed by a concurrent context (e.g., a task).
  • It must not be accessed again from the current task.
  • If it is accessed again (e.g., reused or mutated), the compiler will raise an error.

In the code below, it enforces running the operation once. Using it in the 2nd Task causes a compiler error.

@brennanMKE
brennanMKE / README.md
Created March 26, 2025 16:51
Getting Started with Tailscale

🛠 Getting Started with Tailscale: A Practical Guide

(via ChatGPT)

✨ Overview

This guide will help you set up Tailscale to:

  • Connect multiple Macs at home
  • Remotely manage Raspberry Pis in other networks
@brennanMKE
brennanMKE / FizzBuzz.swift
Last active March 9, 2025 03:44
FizzBuzz with Swift
import Foundation
let fizzValue = "Fizz"
let buzzValue = "Buzz"
let fizzBuzzValue = "FizzBuzz"
let emptyValue = ""
enum FizzBuzz: String {
case fizz = "Fizz"
case buzz = "Buzz"
@brennanMKE
brennanMKE / README.md
Created March 8, 2025 06:53
Swift Arrays, Sequences, and Performance Optimizations

Swift Arrays, Sequences, and Performance Optimizations

(via ChatGPT)

Overview

Swift provides powerful collection types, with Array and Sequence being fundamental. This document explores their differences, best practices, and common pitfalls, including Copy-on-Write (CoW), stride, and Lazy Sequences.


Sequence vs. Collection vs. Array

@brennanMKE
brennanMKE / README.md
Last active March 16, 2025 03:23
Rotatary Encode KY-040 with ESP32-C3

Rotary Encoder KY-040 with ESP32-C3

(via ChatGPT)

Below is a step-by-step guide for wiring a KY-040 rotary encoder to an ESP32-C3-based board on a breadboard, along with a simple example sketch (Arduino-style) showing how to read both rotation and the built-in push button.


1. Rotary Encoder (KY-040) Overview

@brennanMKE
brennanMKE / README.md
Last active February 26, 2025 18:10
Essential Git Aliases

Essential Git Aliases

The following Git aliases are very helpful for my usual workflow.

[alias]
	cb = switch -c
	sw = switch
	wip = commit -m wip
	rr = pull --rebase origin