| #if os(iOS) | |
| import SnapshotTesting | |
| import SwiftUI | |
| import XCTest | |
| public extension XCTestCase { | |
| /// Test the layout of a full-screen SwiftUI view. | |
| /// | |
| /// Currently, this is hardcoded to logical width and height of iPhone 14 Pro screen. It assumes that tests are ran only on iPhone 14 Pro simulator, |
| extension UIResponder { | |
| struct ResponderIterator: IteratorProtocol { | |
| private var responder: UIResponder? | |
| init(_ responder: UIResponder) { self.responder = responder } | |
| mutating func next() -> UIResponder? { | |
| responder = responder?.next | |
| return responder | |
| } | |
| } |
| import UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| let window = UIWindow(frame: UIScreen.main.bounds) |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
| #import <AVFoundation/AVFoundation.h> | |
| @interface MLWAsyncAVPlayer : AVPlayer | |
| @end |
| defimpl Kipatest.Can, for: Kipatest.User do | |
| use Kipatest.Web, :model | |
| def can?(%User{} = subject, :owner, %User{} = user) do | |
| user.id == subject.id | |
| end | |
| end |
| // 1. Go to page https://www.linkedin.com/settings/email-frequency | |
| // 2. You may need to login | |
| // 3. Open JS console | |
| // ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)) | |
| // 4. Copy the following code in and execute | |
| // 5. No more emails | |
| // | |
| // Bookmarklet version: | |
| // http://chengyin.github.io/linkedin-unsubscribed/ |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.