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)| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| HStack { | |
| Text("Hello") | |
| .padding() | |
| .background(.blue) | |
| .overlay { | |
| Color.yellow |
| esphome: | |
| name: plant_moisture | |
| platform: ESP32 | |
| board: esp32dev | |
| wifi: | |
| ssid: "spam" | |
| password: "eggs" | |
| # Enable logging |
| /// Withable is a simple protocol to make constructing | |
| /// and modifying objects with multiple properties | |
| /// more pleasant (functional, chainable, point-free) | |
| public protocol Withable { | |
| init() | |
| } | |
| public extension Withable { | |
| /// Construct a new instance, setting an arbitrary subset of properties | |
| init(with config: (inout Self) -> Void) { |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
| dispatch_queue_t queue = dispatch_queue_create("PlusFlickrPhotoView Queue", DISPATCH_QUEUE_CONCURRENT); | |
| dispatch_async(queue, ^{ | |
| // force decompress of image | |
| UIGraphicsBeginImageContext(CGSizeMake(1, 1)); | |
| [image drawAtPoint:CGPointZero]; | |
| UIGraphicsEndImageContext(); | |
| // set the image on main thread | |
| dispatch_sync(dispatch_get_main_queue(), ^{ |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |