Companion link list for my talk at SwiftCraft 2026, iOSDevUK 2026 and Podlodka iOS Crew 2026. Grouped the way the slide is grouped.
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
| // | |
| // The code snippets below showcase common "problem code" that can take a long time to compile. | |
| // These examples were primarily observed in Swift 2/3 and may no longer be relevant in Swift 4 or higher. | |
| // | |
| /// 1. Array concatenation | |
| // Observed by Robert Gummesson - https://medium.com/@RobertGummesson/regarding-swift-build-time-optimizations-fc92cdd91e31#c75c | |
| // Joining two arrays together with the '+' operator can be expensive to compile. | |
| let someArray = ["a", "b"] + ["c", "d"] |
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
| import UserNotifications | |
| // 1. Request Permission | |
| func requestAuthorization() { | |
| UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { (granted, error) in | |
| if granted { | |
| // Success | |
| } else { | |
| // Error | |
| print(error?.localizedDescription) |
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
| extension UIVisualEffectView { | |
| private var filterLayer: CALayer? { | |
| return layer.sublayers?.first | |
| } | |
| private var blurFilter: NSObject? { | |
| return filterLayer? | |
| .filters?.flatMap({ $0 as? NSObject }) | |
| .first(where: { $0.value(forKey: "name") as? String == "gaussianBlur" }) |
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
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
| /* | |
| The "hello world" of neural networks: a simple 3-layer feed-forward | |
| network that implements an XOR logic gate. | |
| The first layer is the input layer. It has two neurons a and b, which | |
| are the two inputs to the XOR gate. | |
| The middle layer is the hidden layer. This has two neurons h1, h2 that | |
| will learn what it means to be an XOR gate. | |
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
| import UIKit | |
| import Photos | |
| extension PHPhotoLibrary { | |
| // MARK: - PHPhotoLibrary+SaveImage | |
| // MARK: - Public | |
| func savePhoto(image:UIImage, albumName:String, completion:((PHAsset?)->())? = nil) { | |
| func save() { |
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 a list of Hypertext Transfer Protocol (HTTP) response status codes. | |
| /// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes. | |
| /// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum. | |
| enum HTTPStatusCode: Int, Error { | |
| /// The response class representation of status codes, these get grouped by their first digit. | |
| enum ResponseType { | |
| /// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. | |
| case informational |
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
| from django.db import models | |
| class Member(models.Model): | |
| # RE: null vs blank | |
| # | |
| # NULL https://docs.djangoproject.com/en/1.10/ref/models/fields/#null | |
| # Avoid using null on string-based fields such as CharField and TextField because | |
| # empty string values will always be stored as empty strings, not as NULL. | |
| # |
NewerOlder