Skip to content

Instantly share code, notes, and snippets.

View truedat101's full-sized avatar
💭
vr / ai / iot

David J. Kordsmeier truedat101

💭
vr / ai / iot
View GitHub Profile
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@agrancini-sc
agrancini-sc / VideoStreamingWithSupabase.ts
Created December 4, 2025 21:43
VideoStreamingWithSupabase
import { RectangleButton } from 'SpectaclesUIKit.lspkg/Scripts/Components/Button/RectangleButton';
import { SnapCloudRequirements } from './SnapCloudRequirements';
/**
* VideoStreamingController - Live video streaming to Supabase Realtime for real-time viewing
* Based on Remote ARsistance pattern - streams frames for live viewing, no storage
*
* KEY DIFFERENCE from VideoCaptureUploader:
* - This STREAMS for live viewing (no file storage)
* - VideoCaptureUploader UPLOADS for video composition (stores files)
@Matt54
Matt54 / ModelIOLoader.swift
Last active October 14, 2025 07:33
PLY to RealityKit with Grid-Based Decimation (Example: HD Skeleton Scan)
import Foundation
import ModelIO
import simd
nonisolated func loadMeshWithModelIO(from url: URL) throws -> TriangleMesh {
let asset = MDLAsset(url: url)
guard asset.count > 0 else {
throw NSError(domain: "ModelIO", code: 1, userInfo: [NSLocalizedDescriptionKey: "No objects found in file"])
}
@Matt54
Matt54 / BranchSegment.swift
Last active July 12, 2025 08:30
RealityKit Growing/Shrinking Branch using LowLevelMesh
import Foundation
struct BranchSegment {
var startPosition: SIMD3<Float>
var endPosition: SIMD3<Float>
var radius: Float
init(startPosition: SIMD3<Float>, endPosition: SIMD3<Float>, radius: Float) {
self.startPosition = startPosition
self.endPosition = endPosition
@Matt54
Matt54 / MorphingSpherePlaneParams.h
Last active June 22, 2025 01:04
RealityKit LowLevelMesh Sphere to Rectangular Plane Morph with Metal Compute Shader
#ifndef MorphingSpherePlaneParams_h
#define MorphingSpherePlaneParams_h
struct MorphingSpherePlaneParams {
int latitudeBands;
int longitudeBands;
float radius;
float morphAmount;
};
import {
withAlpha,
withoutAlpha,
} from "SpectaclesInteractionKit.lspkg/Utils/color";
/**
* Enhanced 3D Line component with smooth spline interpolation
* Creates a 3D tube by extruding a circular cross-section along a path defined by scene objects.
*/
@component
@agrancini-sc
agrancini-sc / Spline from Line Render
Created May 28, 2025 23:07
Spline from Line Render
import {
withAlpha,
withoutAlpha,
} from "SpectaclesInteractionKit.lspkg/Utils/color";
import InteractorLineRenderer, {
VisualStyle,
} from "SpectaclesInteractionKit.lspkg/Components/Interaction/InteractorLineVisual/InteractorLineRenderer";
/**
* This class provides visual representation for a spline curve through a series of control points.
@agrancini-sc
agrancini-sc / DirectionalShadow.ts
Created April 23, 2025 16:00
Directional Shadow
// Import required modules
const WorldQueryModule = require("LensStudio:WorldQueryModule");
const EPSILON = 0.01;
/**
* DirectionalWorldQuery
*
* A utility that performs world queries in a direction defined by two scene objects.
* It can then project rays from a third object in that same direction.
@skang2-sc
skang2-sc / WebSocketConnection.ts
Created December 31, 2024 19:30
WebSocketConnection Helper
import Event from "SpectaclesInteractionKit/Utils/Event";
const HOST = "wss://[APP_NAME].herokuapp.com";
export class WebSocketConnection {
private remoteServiceModule: RemoteServiceModule = require("LensStudio:RemoteServiceModule");
private webSocket: WebSocket;
private onMessageEvent = new Event<WebSocketMessageEvent>();
public readonly onMessage = this.onMessageEvent.publicApi();
@akingdom
akingdom / PLY file format + notes.md
Last active December 26, 2025 06:02
This document presents the PLY polygon file format, a format for storing graphical objects that are described as a collection of polygons.