When starting work on a new Xcode project, if no CLAUDE.md exists in the project root, create one with:
- Project overview and purpose
- Key architecture decisions
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.
| // 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. |
| 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 |
| 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") |
| import Foundation | |
| import UIKit | |
| @IBDesignable | |
| class DesignableView: UIView { | |
| } | |
| @IBDesignable | |
| class DesignableButton: UIButton { | |
| } |
| 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 |
| // | |
| // AttachmentHandler.swift | |
| // AttachmentHandler | |
| // | |
| // Created by Deepak on 25/01/18. | |
| // Copyright © 2018 Deepak. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
| 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 |