This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.
Agree? Disagree? Feel free to let me know at @JanStette.
Keep it simple, stupid. You ain't gonna need it.
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
| // Douglas Hill, November 2019 | |
| // Find the latest version of this file at https://github.com/douglashill/KeyboardKit | |
| import UIKit | |
| /// A scroll view that allows scrolling using a hardware keyboard like `NSScrollView`. | |
| /// Supports arrow keys, option + arrow keys, command + arrow keys, space bar, page up, page down, home and end. | |
| /// Limitations: | |
| /// - Paging scroll views (isPagingEnabled = true) are not supported yet. | |
| /// - The scroll view must become its own delegate so setting the delegate is not supported yet. |
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 PlaygroundSupport | |
| import SwiftUI | |
| extension UIView { | |
| var renderedImage: UIImage { | |
| let image = UIGraphicsImageRenderer(size: self.bounds.size).image { context in | |
| UIColor.lightGray.set(); UIRectFill(bounds) | |
| context.cgContext.setAlpha(0.75) | |
| self.layer.render(in: context.cgContext) | |
| } | |
| return image |
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 | |
| //It basically just gets image from assets, saves its data to disk and return file URL. | |
| class AssetExtractor { | |
| static func createLocalUrl(forImageNamed name: String) -> URL? { | |
| let fileManager = FileManager.default | |
| let cacheDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] | |
| let url = cacheDirectory.appendingPathComponent("\(name).png") |
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 Foundation | |
| import UIKit | |
| @IBDesignable | |
| class DesignableView: UIView { | |
| } | |
| @IBDesignable | |
| class DesignableButton: UIButton { | |
| } |
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
| In console: | |
| git config credential.helper | |
| You will see: osxkeychain | |
| git config credential.helper sourcetree | |
| Then if you perform git config credential.helper again | |
| You will see: sourcetree |
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
| // | |
| // AttachmentHandler.swift | |
| // AttachmentHandler | |
| // | |
| // Created by Deepak on 25/01/18. | |
| // Copyright © 2018 Deepak. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
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 Foundation | |
| extension DateFormatter { | |
| static let iso8601Full: DateFormatter = { | |
| let formatter = DateFormatter() | |
| formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" | |
| formatter.calendar = Calendar(identifier: .iso8601) | |
| formatter.timeZone = TimeZone(secondsFromGMT: 0) | |
| formatter.locale = Locale(identifier: "en_US_POSIX") | |
| return formatter |
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 MIT License (MIT) | |
| // | |
| // Copyright (c) 2017 Alexander Grebenyuk (github.com/kean). | |
| import Foundation | |
| import Alamofire | |
| import RxSwift | |
| import RxCocoa | |
| // This post is **archived**. For a modern version that uses Async/Await and Actors, see the new article |
NewerOlder