This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test| import SwiftUI | |
| extension View { | |
| /// Adds a task to perform before this view appears or when the trigger | |
| /// is fired. | |
| /// | |
| /// This method behaves like `View.task(id:priority:_:)`, except that it | |
| /// cancels and recreates the task when the `fire` method of the | |
| /// trigger is called. | |
| /// |
| // MARK: - TCAView | |
| public protocol TCAView: View where Body == WithViewStore<ScopedState, ScopedAction, Content> { | |
| associatedtype ViewState | |
| associatedtype ViewAction | |
| associatedtype ScopedState | |
| associatedtype ScopedAction | |
| associatedtype Content | |
| // This gist demonstrates how you can implement versioning for a Codable struct to support loading | |
| // old serialized data after changing the structure. Notable features of this solution: | |
| // | |
| // * No need to make new properties optional, or to perform post-processing on the struct after | |
| // loading in ordeer to populate missing values | |
| // * No need to change the call site - from the outside this struct behaves just the same | |
| // as if we had implemented codable directly in the normal way. | |
| // * Versioning can be applied individually to parents or leaves in a larger tree of | |
| // structs without affecting the other elements | |
| // * This approach will work even if the original struct was not designed with versioning in mind |
| import Foundation | |
| import os.log | |
| class URLCacheTest { | |
| let logger = Logger(subsystem: "URLCacheTest", category: "main") | |
| // HTTP HEADERS: | |
| // Date: Wed, 04 Nov 2020 11:13:24 GMT | |
| // Server: Apache | |
| // Strict-Transport-Security: max-age=63072000; includeSubdomains; preload |
| # A Best in Class Checklist | |
| A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10. | |
| > To use this, create a Github Issue in your own repo, and simply copy and paste this text. | |
| ## iOS Core Technology | |
| _Things any iOS app can benefit from_ | |
| - [ ] iCloud Sync | |
| - [ ] Focus Filter Support |
| import UIKit | |
| import AVFoundation | |
| class ViewController: UIViewController { | |
| // Duplicate players to handle optional cross-fading. | |
| let playerQueue = [AVPlayer(), AVPlayer()] | |
| var timeObserverToken: Any? |
| import UIKit | |
| #if canImport(SwiftUI) && DEBUG | |
| import SwiftUI | |
| struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable { | |
| let viewController: ViewController | |
| init(_ builder: @escaping () -> ViewController) { | |
| viewController = builder() | |
| } |
| // MIT License | |
| // | |
| // Copyright (c) 2019 Rostyslav Dovhaliuk | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
| import UIKit | |
| /// A validation rule for text input. | |
| public enum TextValidationRule { | |
| /// Any input is valid, including an empty string. | |
| case noRestriction | |
| /// The input must not be empty. | |
| case nonEmpty | |
| /// The enitre input must match a regular expression. A matching substring is not enough. | |
| case regularExpression(NSRegularExpression) |
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test