The following are appendices from Optics By Example, a comprehensive guide to optics from beginner to advanced! If you like the content below, there's plenty more where that came from; pick up the book!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env xcrun -sdk macosx swift | |
| // Displays UI in an NSWindow which can interact with the commandline | |
| // Usage: `echo "Bar" | ./swift-ui-commandline-tool.swift` | |
| import Foundation | |
| import SwiftUI | |
| extension CommandLine { | |
| static let input: String = { AnyIterator { readLine() }.joined() }() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension RangeReplaceableCollection { | |
| static func += (collection: inout Self, element: Element) { | |
| collection.append(element) | |
| } | |
| static func += (collection: inout Self, element: Element?) { | |
| if let element = element { | |
| collection.append(element) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| extension Decodable where Self: Encodable { | |
| /// Creates a new instance and changes the value for the provided key. | |
| /// | |
| /// - Parameters: | |
| /// - key: The key path to the property that you want to modify. | |
| /// Use period to separate levels and [] for indexes. | |
| /// Examples: "id", "name.firstName", "children[2].name.firstName" | |
| /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "hooks": { | |
| "PostToolUse": [ | |
| { | |
| "matcher": "Write|Edit", | |
| "hooks": [ | |
| { | |
| "type": "command", | |
| "command": "~/scripts/doc-generator.sh" | |
| } |
This guide explains how to configure Xcode's built-in Claude Code integration to work with third-party API endpoints instead of the official Anthropic API. You need macOS 26.2+ and Xcode 26.3+ for the Claude Code integration.
You need to first install Xcode's own Claude Code instance, with its own Claude Code binary.
Xcode Settings -> Intelligence -> Anthropic -> Claude Agent -> press Get button
OlderNewer