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 SwiftUI | |
| public struct Squircle: InsettableShape { | |
| // MARK: Properties | |
| var cornerSize: CGSize | |
| var inset = 0.0 | |
| // MARK: Initializers |
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 SwiftUI | |
| struct ContentView: View { | |
| static let maskWidth = 136.0 | |
| static let duration = 5.0 | |
| @State var offset1 = -Self.maskWidth | |
| @State var offset2 = -Self.maskWidth | |
| @State var offset3 = -Self.maskWidth | |
| @State var offset4 = -Self.maskWidth |
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
| // A view that can flip between its "front" and "back" side. | |
| // | |
| // Animation implementation based on: | |
| // Chris Eidhof, Keyframe animations <https://gist.github.com/chriseidhof/ea0e435197f550b195bb749f4777bbf7> | |
| import SwiftUI | |
| // MARK: - Chris's keyframe animation design | |
| struct Keyframe<Data: Animatable> { |
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 UIAlertController { | |
| /// Creates a view controller for notifying the user that a conversion is occurring. Accepts a block that is executed upon conversion completion. | |
| static func createConvertingAlertController(onConversionCompletion: @escaping () -> Void) -> UIAlertController { | |
| // The title font corresponds to Dynamic Type style "Headline" | |
| let titleFont = UIFont.preferredFont(forTextStyle: .headline) | |
| let calculatorImageView = UIImageView(image: UIImage(named: "calculator.fill", in: nil, with: UIImage.SymbolConfiguration(font: UIFont.systemFont(ofSize: titleFont.pointSize * 2.0, weight: .semibold)))) | |
| let measuringAttributedStringHeight = NSAttributedString(string: "Penguin", attributes: [.font: titleFont]).boundingRect(with: .zero, options: [.usesFontLeading, .usesLineFragmentOrigin], context: nil).height | |
| let desiredOffset = 15.0 + calculatorImageView.bounds.height | |
| let totalNewlinePrefixes = Int((desiredOffset / measuringAttributedStringHeight). |
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 Color { | |
| /// Return a random color | |
| static var random: Color { | |
| return Color( | |
| red: .random(in: 0...1), | |
| green: .random(in: 0...1), | |
| blue: .random(in: 0...1) | |
| ) | |
| } | |
| } |
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 UIView { | |
| struct EmbedInsets { | |
| let top: CGFloat? | |
| let left: CGFloat? | |
| let right: CGFloat? | |
| let bottom: CGFloat? | |
| init(top: CGFloat? = nil, bottom: CGFloat? = nil, left: CGFloat? = nil, right: CGFloat? = nil) { | |
| self.top = top |
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
| Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
| ActivityTweet | |
| generic_activity_highlights | |
| generic_activity_momentsbreaking | |
| RankedOrganicTweet | |
| suggest_activity | |
| suggest_activity_feed | |
| suggest_activity_highlights | |
| suggest_activity_tweet |
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
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2025 | |
| * https://bsky.app/profile/tholanda.com | |
| * | |
| * (the twitter account is now deleted, please, do not try to reach me there) | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license |
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
| #!/usr/bin/swift sh | |
| import Foundation | |
| import PromiseKit // @mxcl ~> 6.5 | |
| import Swifter // @mattdonnelly == b27a89 | |
| let swifter = Swifter( | |
| consumerKey: "FILL", | |
| consumerSecret: "ME", | |
| oauthToken: "IN", | |
| oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html" |
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, December 2018 | |
| // Made for https://douglashill.co/reading-app/ | |
| // Find the latest version of this file at https://github.com/douglashill/KeyboardKit | |
| import UIKit | |
| /// A table view that allows navigation and selection using a hardware keyboard. | |
| /// Only supports a single section. | |
| class KeyboardTableView: UITableView { | |
| // These properties may be set or overridden to provide discoverability titles for key commands. |
NewerOlder