This guide shows the steps required to set up a macOS device so that a screen recoding can capture both what the presenter is speaking (via the input device), as well as any system audio (such as conference call questions).
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
# strict: true | |
# File organization | |
# included: | |
# - Sources | |
# - Tests | |
excluded: | |
- .build | |
- .swiftpm | |
- DerivedData |
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
--swiftversion 5.9 | |
# Opt-in rule config | |
--disable all | |
# Explicitly disabled (opt-in) rules: | |
# See: https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#acronyms | |
--disable acronyms |
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
// 1. Decorate the class itself with e.g. @MainActor | |
// 2. If that isn't possible, here is an example workaround: | |
deinit { | |
nonisolated(unsafe) let obj = self | |
MainActor.assumeIsolated { | |
obj.dismiss(animated: false) | |
} | |
} |
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
print(Unmanaged.passUnretained(self).toOpaque()) |
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
@dynamicMemberLookup | |
final class UnsafeSendableBox<T>: @unchecked Sendable { | |
let value: T | |
init(_ value: T) { | |
self.value = value | |
} | |
subscript<Value>(dynamicMember keyPath: KeyPath<T, Value>) -> Value { | |
value[keyPath: keyPath] | |
} |
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
@discardableResult | |
func logMemoryPressure() -> DispatchSourceProtocol { | |
// Wrapper class to make DispatchSourceMemoryPressure sendable | |
final class SendableDispatchMemoryPressureSource: @unchecked Sendable { | |
let source: any DispatchSourceMemoryPressure | |
init(_ source: any DispatchSourceMemoryPressure) { | |
self.source = source | |
} | |
func activate() { |
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
@discardableResult | |
@preconcurrency func logMemoryPressure() -> DispatchSourceProtocol { | |
let source = DispatchSource.makeMemoryPressureSource(eventMask: .all, queue: nil) | |
let queue = DispatchQueue( | |
label: "com.example.memoryPressure") | |
queue.async { | |
source.setEventHandler { | |
guard !source.isCancelled else { return } | |
let event = source.data |
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
// Source: https://www.douggregor.net/posts/swift-for-cxx-practitioners-extensions/ | |
extension UInt32 { | |
subscript(index: Int) -> Bool { | |
get { | |
(self & UInt32(1) << index) != 0 | |
} | |
set { | |
let mask = UInt32(1) << index | |
self = (self & ~mask) | (newValue ? mask : 0) |
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
# Source: https://www.reddit.com/r/MicrosoftEdge/comments/16u0nuf/i_know_how_to_launch_edge_into_a_specific_profile/ | |
cat "$HOME/Library/Application Support/Microsoft Edge/Default/Workspaces/WorkspacesCache" | |
open -a '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge' --args --profile-directory="ProfileName" --launch-workspace=<workspace-id> |
NewerOlder