Skip to content

Instantly share code, notes, and snippets.

View lintmachine's full-sized avatar

Chris D'Annunzio lintmachine

View GitHub Profile
@lintmachine
lintmachine / NWConnection+Publisher.swift
Created December 13, 2022 23:02
NWConnection extensions, which add a Combine Publisher interface for sending Data over a network connection.
import Combine
import Foundation
import Network
public extension NWConnection {
func send(content: Data?) -> some Publisher<Void, Error> {
Deferred {
Future<Void, Error> { [weak self] promise in
guard let self = self else { return }
self.send(
@lintmachine
lintmachine / CombineHandshake.md
Last active December 14, 2022 02:43
Combine Publisher / Subscriber Handshake

Combine Publisher / Subscriber Handshake

The Publisher receives the Subscriber

      Publisher.receive(subscriber:)

The Publisher creates the Subscription passing in self (the Publisher) and the Subscriber

let subscription = Subscription(self, subscriber)
@lintmachine
lintmachine / resume.json
Last active March 27, 2020 19:54
Chris D'Annunzio Resume
{
"meta": {
"theme": "crispy-potato",
"palette": {
"primary": "grey",
"secondary": "blue"
}
},
"basics": {
"name": "Chris D'Annunzio",