This gist is part of a blog post:
This file contains hidden or 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
| // adapted from default | |
| export const settings = { | |
| ...defaultSettings, | |
| useStunTurn: true, | |
| p2p: { | |
| enabled: false, // disabled for testing | |
| useStunTurn: true, | |
| }, | |
| // Some other settings for resolution & parallel talking as relevant for our usecase | |
| } |
# Remember, never run shell scripts from the internet: go ahead verify the SHA!
curl https://gist.githubusercontent.com/hermanbanken/96925cb9593137fd6816cefd8ac7e93a/raw/070f6bde93b362388b5612648ef17ae612e3cc5c/scan_filenames.sh | \
sed s/=grep/=ggrep/ | \
bash -x
This file contains hidden or 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
| kind: Deployment | |
| # repro1.yaml | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: demo | |
| namespace: default | |
| spec: | |
| replicas: 2 | |
| # in next apply we'll remove this replicas property |
At Q42 we use Docker a lot nowadays. A few projects use full-fledged Kubernetes on GKE with Docker images. Other projects use docker with AppEngine Flex, which has become our standard for quickly deploying a standalone workload, because it does the boring things like hosting & SSL (LetsEncrypt) for us.
In one particularly large project (Hue) we have a multitude of different micro-services that all have separate Docker images. Combined with CI/CD releasing to our test & staging environments,
This file contains hidden or 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
| node_modules | |
| package-lock.json |
This file contains hidden or 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
| type Muxed struct { | |
| IsLast bool; | |
| Payload []byte; | |
| } | |
| type State struct { | |
| ReplyTo chan interface{} | |
| } | |
| // Incoming attaches [channel(buffer: 1)], if Mux finds multi-packet reply, |
This file contains hidden or 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
| // This is the bare-minimum you need to know to create a SwiftUI.BindableObject with a Combine.Publisher | |
| final class MyUserData: BindableObject { | |
| // this ==vvvvvvv must be a `Publisher` type | |
| let didChange = PassthroughSubject<MyUserData, Never>() | |
| var myProperty = false { | |
| didSet { | |
| // this ==vvvvvvv | |
| didChange.send(self) |
This file contains hidden or 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
| // | |
| // Test.swift | |
| // Q42 | |
| // | |
| // Created by Herman Banken on 6/4/19. | |
| // | |
| import Foundation | |
| import Combine | |
| import RxSwift |
This file contains hidden or 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
| @available(iOS 13.0, *) | |
| func exampleCombineKVO () { | |
| let article = Article(title: "Test", body: "Lorum ipsum") | |
| // For a KeyPath 101, see https://www.swiftbysundell.com/posts/the-power-of-key-paths-in-swift | |
| let keypath: ReferenceWritableKeyPath<Article,String> = \.title | |
| // The new Combine stuff: | |
| let sink = Subscribers.Assign(object: article, keyPath: keypath) | |
| let source = Publishers.Future<String, Never> { subscriber in |