Skip to content

Instantly share code, notes, and snippets.

View PavelHolec's full-sized avatar

Pavel Holec PavelHolec

  • Czech Republic > Brno
View GitHub Profile
@helje5
helje5 / servedocc.swift
Last active May 12, 2025 20:20
Small Swift Script to serve `.doccarchive`s to the browser
#!/usr/bin/swift sh
import MacroExpress // @Macro-swift
// MARK: - Parse Commandline Arguments & Usage
func usage() {
let tool = path.basename(process.argv.first ?? "servedocc")
print(
"""
@ole
ole / README.md
Created August 7, 2020 18:51
Extract a value from the SwiftUI environment by the name of its associated EnvironmentKey (e.g. "ForegroundColorKey").

Extract a value from the SwiftUI environment by the name of its associated EnvironmentKey (e.g. "ForegroundColorKey").

Tested only in Xcode 12.0 beta 4 in the iOS simulator. May break in other environments because it uses reflection. If SwiftUI's private type hierarchy changes, it will probably stop working.