-
Configure the session when a SharePlay activity starts, and handle events that occur during the lifetime of the activity.
When one person in a group starts an activity, other people’s devices display system UI to prompt them to join that activity. When each person joins, the system prepares a GroupSession object for the activity and delivers it to their app. Your app uses that session object to:
- Prepare any required UI.
- Start the activity, monitor its state, and respond to changes.
- Synchronize activity-related information. >
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 Combine | |
import Foundation | |
import os | |
@MainActor public final class PollingDataModel<DataModels: Sendable> { | |
private let logger = Logger(subsystem: "Polling", category: "PollingDataModel") | |
private var pollingTask: Task<Void, Never>? | |
private var currentlyPolling = 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
import Foundation | |
extension Task { | |
static func sleep(until target: Date) async throws where Success == Never, Failure == Never { | |
let duration = target.timeIntervalSinceNow | |
try await Self.sleep(for: .seconds(duration)) | |
} | |
} | |
print("Waiting for 1s...") |
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
struct ReducedReplayAsyncStream<Element> { | |
typealias Reduce = (_ partialResult: inout Element, _ nextResult: Element) -> Void | |
private let storage: _Storage | |
private var originalStream: AsyncStream<Element> | |
init( | |
bufferingPolicy limit: AsyncStream<Element>.Continuation.BufferingPolicy = .unbounded, | |
initialResult: Element, |
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 Optional { | |
func map<T>( | |
transform: (Wrapped) async throws -> T | |
) async rethrows -> T? { | |
guard case let .some(value) = self else { return nil } | |
return try await transform(value) | |
} | |
} |
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
Remove file from git repository (history) | |
SOLUTION: This is the shortest way to get rid of the files: | |
1. check .git/packed-refs - my problem was that I had there a refs/remotes/origin/master line for a remote repository, delete it, otherwise git won't remove those files | |
2. (optional) git verify-pack -v .git/objects/pack/#{pack-name}.idx | sort -k 3 -n | tail -5 - to check for the largest files | |
3. (optional) git rev-list --objects --all | grep #{SHA_FROM_#_3} - to check what files those are |
vmmap --summary X.memgraph
vmmap X.memgraph | rg "MEMORY REGION NAME"
vmmap --verbose X.memgraph | rg "MEMORYREGION"
leaks --traceTree 0xSTARTINGMEMORYADDRESS
malloc_history X.memgraph --fullStacks 0xSTARTINGMEMORYADRESS
- Other helpful commands
vmmap --pages X.memgraph
leaks X.memgraph
heap X.memgraph
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 | |
# Runs SwiftFormat on changed Swift files in the project. | |
# The re-formatting may not be caught at commit time, though, and so may require a subsequent commit/amending. | |
# If any command fails, exit immediately with that command's exit status. | |
# shellcheck disable=SC3040 | |
set -eo pipefail | |
# Redirect output to stderr. |
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
-- Yoneda -------------------------------------------------------------- | |
newtype Yoneda f a = Yoneda { runYoneda :: forall b. ((a -> b) -> f b) } | |
instance Functor (Yoneda f) where | |
fmap f y = Yoneda (\ab -> runYoneda y (ab . f)) | |
toYoneda :: Functor f => f a -> Yoneda f a | |
toYoneda fa = Yoneda (\f -> fmap f fa) | |
fromYoneda :: Yoneda f a -> f a |
found at: http://fascinated.fm/post/2379188731/getting-a-motorola-sbg6580-into-bridge-mode-on
Getting a Motorola SBG6580 into “Bridge” mode on TimeWarner Wideband
- Unplug coax cable from Motorola
- Hold down the white reset button on the back panel with a pen for 30s. This resets all settings to factory defaults. The modem will be auto-reconfigured once you plug in the coax cable.
- When modem is back on plug in a computer with an Ethernet cable into the modem.
- Connect to http://192.168.0.1 and login with “admin” / “motorola”
- Now you will make some changes:
- Wireless -> Primary Network -> Disabled
NewerOlder