This file contains 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 UIKit | |
struct UILabelDebugOptions: OptionSet { | |
let rawValue: Int | |
static let bounds = UILabelDebugOptions(rawValue: 1 << 0) | |
static let ascender = UILabelDebugOptions(rawValue: 1 << 1) | |
static let descender = UILabelDebugOptions(rawValue: 1 << 2) | |
static let xHeight = UILabelDebugOptions(rawValue: 1 << 3) | |
static let capHeight = UILabelDebugOptions(rawValue: 1 << 4) |
This file contains 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 URL { | |
enum MyURLNamespace { | |
// Static URL, always in memory | |
static let gitHub = URL(string: "https://github.com/BjornRuud")! | |
// Computed URL, created on demand | |
static var gitHubWithStaticParameter: URL { | |
let param = "SomeParameter" | |
return URL(string: "https://github.com/BjornRuud/\(param)")! | |
} |
This file contains 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
#!/bin/sh | |
# Write some general information | |
echo System Temperatures - `date` | |
uptime | awk '{ print "\nSystem Load:",$10,$11,$12,"\n" }' | |
# Write CPU temperatures | |
echo "CPU Temperature:" | |
sysctl -a | egrep -E "cpu\.[0-9]+\.temp" |
This file contains 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 SwiftUI | |
private struct ViewOnChangeValueObserver<Content: View, Value: Equatable>: View { | |
let content: Content | |
let value: Value | |
let action: (Value) -> Void | |
@State private var oldValue: Value | |
init( |