See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| /*: | |
| This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI | |
| The only purpose of this code is to implement those wrappers myself | |
| just to understand how they work internally and why they are needed, | |
| ⚠️ This is not supposed to be a reference implementation nor cover all | |
| subtleties of the real Binding and State types. | |
| The only purpose of this playground is to show how re-implementing | |
| them myself has helped me understand the whole thing better |
| ACTION = build | |
| AD_HOC_CODE_SIGNING_ALLOWED = NO | |
| ALTERNATE_GROUP = staff | |
| ALTERNATE_MODE = u+w,go-w,a+rX | |
| ALTERNATE_OWNER = grantdavis | |
| ALWAYS_SEARCH_USER_PATHS = NO | |
| ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
| APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
| APPLE_INTERNAL_DIR = /AppleInternal | |
| APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import SwiftUI | |
| fileprivate extension DateFormatter { | |
| static var month: DateFormatter { | |
| let formatter = DateFormatter() | |
| formatter.dateFormat = "MMMM" | |
| return formatter | |
| } | |
| static var monthAndYear: DateFormatter { |
| image: docker:19.03 | |
| variables: | |
| REPOSITORY_URL: <AWS_ACCOUNT_ID>.dkr.ecr.<REGION_NAME>.amazonaws.com/<ECR_REPOSITORY_NAME> | |
| REGION: <REGION_NAME> | |
| TASK_DEFINITION_NAME: <TASK_DEFINITION_NAME> | |
| CLUSTER_NAME: <CLUSTER_NAME> | |
| SERVICE_NAME: <SERVICE_NAME> | |
| CPU: <CPU> | |
| MEMORY: <MEMORY> |
| extension Publisher where Self.Failure == Never { | |
| public func assignNoRetain<Root>(to keyPath: ReferenceWritableKeyPath<Root, Self.Output>, on object: Root) -> AnyCancellable where Root: AnyObject { | |
| sink { [weak object] (value) in | |
| object?[keyPath: keyPath] = value | |
| } | |
| } | |
| } |
| import Combine | |
| import Foundation | |
| extension NSObjectProtocol where Self: NSObject { | |
| /// Assigns each unique element assigned to the key paths specified to the inverse object. | |
| func bidirectionallyAssign<Value: Equatable, B: NSObject>( | |
| from firstKeyPath: ReferenceWritableKeyPath<Self, Value>, | |
| to secondKeyPath: ReferenceWritableKeyPath<B, Value>, | |
| on otherObject: B | |
| ) -> [AnyCancellable] { |
| import Combine | |
| /** | |
| An observable, mutable property. | |
| Replays the current value when subscribed. | |
| */ | |
| @propertyWrapper | |
| struct Published<Output>: Publisher { | |
| typealias Failure = Never |