Skip to content

Instantly share code, notes, and snippets.

View marcprux's full-sized avatar
🔆

Marc Prud'hommeaux marcprux

🔆
  • New England
  • 00:39 (UTC -04:00)
View GitHub Profile
func loadSourceRoot() throws -> URL {
let env = ProcessInfo.processInfo.environment // "DYLD_LIBRARY_PATH": "/Users/marc/Library/Developer/Xcode/DerivedData/App-eyahphpvsfdoezahxmpgdlrnhwxg/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection"
guard let dyld = env["DYLD_LIBRARY_PATH"]?.split(separator: ":").first else { // e.g. /Users/marc/Library/Developer/Xcode/DerivedData/App-eyahphpvsfdoezahxmpgdlrnhwxg/Build/Products/Debug-iphonesimulator
throw CocoaError(.fileNoSuchFile)
}
// we have a bunch of potential places to guess here, but this is one of them…
let workspaceInfo = URL(fileURLWithPath: "../../../info.plist", isDirectory: false, relativeTo: URL(fileURLWithPath: String(dyld), isDirectory: true))
import ui;
ui.VStack([
ui.Text("Hello App!").font(ui.Font.largeTitle),
ui.Text("(saving changes will automatically reload the UI)").font(ui.Font.caption)
]);
@marcprux
marcprux / app.World-Fair.jackscript
Last active October 4, 2022 19:23
JackScript plug-in for World Fair.app
{
"appid": "app.World-Fair",
"name": "Simple World Fair JackScript",
"description": "This is an example JackScript plug-in for the World Fair app.",
"requires": {
"ui": [0, 0, 1],
"console": [0, 0, 1]
}
}
{
"name": "Example Metadata",
"version": [1,2,3]
}; // prelude JSON metadata
let x = 123;
console.log(`Number: ${x}!!`);
@marcprux
marcprux / gist:4cfea832c767212d9f29f50bb656331c
Created September 10, 2022 19:12
PosterBoard crash from WKDefaultWallpaperManager
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Incident Identifier: 2D7B7829-3F35-4650-BC6D-1912CB8A21EA
CrashReporter Key: E4C4B189-1382-2C5A-B148-CD6E07701010
Hardware Model: MacBookPro18,2
Process: PosterBoard [8272]
Path: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications/PosterBoard.app/PosterBoard
Identifier: com.apple.PosterBoard
@marcprux
marcprux / SwiftUI.OutlineView.crash
Created May 13, 2021 12:09
Stack dump of SwiftUI.OutlineView bridging to NSOutlineView (and crashing)
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x00007fff41c65b57 in specialized Array._checkSubscript(_:wasNativeTypeChecked:) ()
#1 0x00007fff41ee03d8 in OutlineListRootViewTree.traits(forRowAt:) ()
#2 0x00007fff41ee066c in protocol witness for ListRootViewTree.traits(forRowAt:) in conformance OutlineListRootViewTree ()
#3 0x00007fff425713a0 in ListStyleDataSource.isTreeLeaf(forRowAt:) ()
#4 0x00007fff42072613 in NSOutlineViewListCoordinator.outlineView(_:isItemExpandable:) ()
#5 0x00007fff420729be in @objc NSOutlineViewListCoordinator.outlineView(_:isItemExpandable:) ()
#6 0x00007fff22e19b38 in -[NSOutlineView _nonStaticDataSourceIsItemExpandable:] ()
#7 0x00007fff22e08de3 in loadItemEntryLazyInfoIfNecessary ()
#8 0x00007fff22e22394 in findAndLoadRowEntryForUnloadedLazyItem ()
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x00007fff20322e69 in nanov2_allocate_from_block ()
#1 0x00007fff20322650 in nanov2_allocate ()
#2 0x00007fff2032257d in nanov2_malloc ()
#3 0x00007fff2033cff5 in _malloc_zone_malloc ()
#4 0x00007fff2cb8d0e8 in swift_slowAlloc ()
#5 0x00007fff2cb8d257 in swift_allocObject ()
#6 0x00007fff4228a9b0 in AnyViewList.Transform.apply(sublist:) ()
#7 0x00007fff421b8e3e in TransformedList.TransformItem.apply(sublist:) ()
#8 0x00007fff421b8e3e in TransformedList.TransformItem.apply(sublist:) ()
/**
```
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x00007fff2cb8dead in swift_retain ()
#1 0x00007fff2cb90e55 in swift::metadataimpl::ValueWitnesses<swift::metadataimpl::SwiftRetainableBox>::initializeWithCopy(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*) ()
#2 0x00007fff2cbaf29d in swift::metadataimpl::ValueWitnesses<swift::metadataimpl::OpaqueExistentialBox<1u> >::initializeWithCopy(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*) ()
#3 0x00007fff421b8f10 in outlined init with copy of ViewList? ()
#4 0x00007fff421b8e1a in TransformedList.TransformItem.apply(sublist:) ()
#5 0x00007fff421b8e3e in TransformedList.TransformItem.apply(sublist:) ()
#6 0x00007fff421b8783 in closure #1 in ViewList.visitChildNodes(from:transform:applying:) ()
@marcprux
marcprux / FormDemoApp.swift
Created February 17, 2021 22:54
Example of aligning labels in SwiftUI.Form on macOS
//
// FormDemoApp.swift
// FormDemo
//
// Created by Marc Prud'hommeaux
//
import SwiftUI
@main