Skip to content

Instantly share code, notes, and snippets.

View adam-zethraeus's full-sized avatar
🏔️

adamz adam-zethraeus

🏔️
View GitHub Profile
@Matt54
Matt54 / MarchingCubesParams.h
Last active September 22, 2025 17:20
Marching Cubes Metaballs in RealityKit (Metal + LowLevelMesh)
#ifndef MarchingCubesParams_h
#define MarchingCubesParams_h
#include <simd/simd.h>
struct MarchingCubesParams {
simd_uint3 cells;
simd_float3 origin;
simd_float3 cellSize;
float isoLevel;
simd_float3 centerA;
#!/usr/bin/env zsh
# Multi-project worktree manager with Claude support
#
# ASSUMPTIONS & SETUP:
# - Your git projects live in: ~/projects/
# - Worktrees will be created in: ~/projects/worktrees/<project>/<branch>
# - New branches will be named: <your-username>/<feature-name>
#
# DIRECTORY STRUCTURE EXAMPLE:
# ~/projects/
@markmals
markmals / *Pointer.swift
Last active November 12, 2024 16:44
An approximation of Rust & C++ smart pointers in Swift with non-copyable types
public protocol Pointer<Pointee>: ~Copyable {
associatedtype Pointee
var pointee: Pointee { get nonmutating set }
}
public struct UniquePointer<Pointee>: ~Copyable, Pointer {
private let memory: UnsafeMutablePointer<Pointee>
public var pointee: Pointee {
get { memory.pointee }
@markmals
markmals / ReferenceSet.swift
Last active November 12, 2024 16:46
Vanilla Reactive System
// A reference type Set
private final class ReferenceSet<Element: Hashable>: Hashable, Collection {
typealias Element = Element
typealias Iterator = Set<Element>.Iterator
typealias Index = Set<Element>.Index
typealias Indices = Set<Element>.Indices
typealias SubSequence = Set<Element>.SubSequence
private var inner = Set<Element>()
@robert-cronin
robert-cronin / concatenate_repo.sh
Last active September 12, 2025 13:06
A script for concatenating all the files of a git repo into one file which you can feed into large context LLMs for understanding dependencies
#!/bin/bash
# Check if the script received the correct number of arguments
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <repo_path> <output_file>"
exit 1
fi
REPO_PATH=$1
OUTPUT_FILE=$2
@ole
ole / swift-has-feature.sh
Last active December 6, 2025 06:53
swift-list-features: List Swift compiler upcoming and experimental feature flags. If you're using Swift 6.2 or later, `swift -print-supported-features` does something very similar, but only for the compiler version you have installed. · swift-has-feature: Check if a given compiler knows a specific feature flag, and whether it's an upcoming or ex…
#!/bin/zsh
# Test if the Swift compiler knows about a particular language feature.
#
# Usage:
#
# swift-has-feature [--swift SWIFT_PATH] [--language-version LANGUAGE_VERSION] FEATURE
#
# The feature should be an upcoming or experimental language feature,
# such as `"StrictConcurrency"` or `"ExistentialAny"`.
@realvjy
realvjy / ChoasLinesShader.metal
Last active December 8, 2025 22:02
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@markmals
markmals / signals.swift
Last active March 24, 2024 06:02
An implementation of Solid.js's signals API using Swift's @observable macro
import Foundation
import Observation
@Observable
final class Signal<T> {
var value: T
init(value: T) {
self.value = value
}
@dkun7944
dkun7944 / CDView.swift
Last active September 28, 2025 06:34
SwiftUI + Swift.Shader CD
//
// CDView.swift
// CD
//
// Created by Daniel Kuntz on 7/3/23.
//
import SwiftUI
struct ShapeWithHole: Shape {
@kylemcdonald
kylemcdonald / function-calling.ipynb
Created June 14, 2023 01:10
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.