Skip to content

Instantly share code, notes, and snippets.

@avnerbarr
avnerbarr / RealityKit.md
Created June 14, 2026 10:54
RealityKit Game Development Guide

RealityKit Game Development Guide

Non-AR 3D Games on macOS & iPadOS

Generated from a full walkthrough session — covers everything from zero to a working Mario-style game.


Table of Contents

  1. Why RealityKit?
// lock code around a file handle when multiple processes running and single access
fn main() {
std::thread::spawn(|| {
let lock = with_lock("my_lock".to_string());
loop {
let r = lock(|| {
sleep(Duration::from_millis(100));
"blah"
});
sleep(Duration::from_millis(500));
import java.util.concurrent.locks.ReentrantReadWriteLock
import com.typesafe.scalalogging.LazyLogging
import scala.collection.mutable
import scala.concurrent.duration._
/**
* Trivial cache which is lazily limited to size - when size is exceeded with evict the oldest object
* @param limitSize the limit size option
endpoint status

there are 1161 potential requests in file

❌ POST /recommend?_=1565526947122 BODY: {"sec":8771591,"uid":"-2769713442859793034","data":{"wId":"55571","fId":16583,"maxProducts":24,"rules":[{"id":217054,"type":"include","slots":[],"isContextAware":true}],"ctx":{"type":"PRODUCT","data":["2000352323022"]},"filtering":[]},"v":1} 1c1

/Users/avnerbarr/workspace/docker-dev/offline-scripts/GORMirror: ./.build/x86_64-apple-macosx/debug/GORMirror there are 1161 potential requests in file ✅ Request(httpVerb: GORMirror.Request.Verb.POST, endpoint: "/v2/recommend?_=1565526951847", requestBody: Optional(424 bytes), headers: nil)

❌ Request(httpVerb: GORMirror.Request.Verb.POST, endpoint: "/recommend?_=1565526947636", requestBody: Optional(503 bytes), headers: nil)
sku name price categories group_id image_url in_stock url keywords
a a 1 a a http://a.com true http://blah.com a
@avnerbarr
avnerbarr / Arkit.md
Created June 22, 2019 09:14
ARKit learning

Scene

Drag ARKitSCNView to story builder or make in code

@IBOutlet weak var sceneView: ARSCNView!
  let configuration = ARWorldTrackingConfiguration()

Add a configuration object to the view controller

sku image_url group_id name url in_stock price categories
sku-1 http://sku-1.com/a.png group-sku-1 name-sku-1 http://sku-1.com true 5 sku-1
sku group_id name url price in_stock image_url categories
123 123 test product https://www.linio.com 1 false https://www.linio.com Test
567 567 test product 2 https://www.linio.com 1 true https://www.linio.com Test