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
| // | |
| // realm_testApp.swift | |
| // realm-test | |
| // | |
| // Created by Matteo Spada on 26/03/25. | |
| // | |
| import RealmSwift | |
| import SwiftUI |
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
| #!/bin/bash | |
| USERNAME=youruser # TODO: Customize the sudo non-root username here | |
| # Create user | |
| useradd --create-home --shell "/bin/bash" --groups sudo "${USERNAME}" | |
| passwd --delete "${USERNAME}" | |
| # Create SSH directory for sudo user and move keys over | |
| home_directory="$(eval echo ~${USERNAME})" | |
| mkdir --parents "${home_directory}/.ssh" |
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
| require "dotenv" | |
| before_all do | |
| Dotenv.load ".env.secret" | |
| end | |
| default_platform(:mac) | |
| platform :mac do | |
| lane :update_plist_prod do | |
| update_plist( |
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 | |
| /// MARK: Errors | |
| enum DeepLErrors: Error { | |
| case decode | |
| case tooManyRequests | |
| case quotaExceeded | |
| case temporaryError | |
| case serverError | |
| case forbidden |
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 RatingsView { | |
| func createImage(icon: UIImage, appName: String, developerName: String, ratingsCount: String, averageRating: String) -> UIImage { | |
| let renderer = UIGraphicsImageRenderer(size: CGSize(width: 1600, height: 900)) | |
| let imageToShare = renderer.image { ctx in | |
| // Background gradient | |
| let gradient = CGGradient(colorsSpace: nil, colors: [UIColor(red: 0.101, green: 0.729, blue: 0.973, alpha: 1.0).cgColor, UIColor(red: 0.114, green: 0.478, blue: 0.949, alpha: 1.0).cgColor] as CFArray, locations: nil)! | |
| ctx.cgContext.drawLinearGradient(gradient, start: CGPoint(x: 0, y: 0), end: CGPoint(x: 0, y: 900), options: []) |
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
| // | |
| // KeywordViewModel.swift | |
| // Created by Matteo Spada on 09/07/22. | |
| // | |
| import Foundation | |
| import CoreData | |
| import SwiftUI | |
| class KeywordViewModel: ObservableObject, Identifiable, Equatable { |
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
| func rateApp() { | |
| let urlStr = "itms-apps://itunes.apple.com/app/id1614061909?action=write-review" | |
| guard let url = URL(string: urlStr), UIApplication.shared.canOpenURL(url) else { return } | |
| UIApplication.shared.open(url, options: [:], completionHandler: nil) | |
| } |
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 | |
| import UIKit | |
| import MessageUI | |
| struct MailView: UIViewControllerRepresentable { | |
| @Environment(\.presentationMode) var presentation | |
| @Binding var result: Result<MFMailComposeResult, Error>? | |
| class Coordinator: NSObject, MFMailComposeViewControllerDelegate { |
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 Person: Identifiable { | |
| let givenName: String | |
| let familyName: String | |
| let emailAddress: String | |
| let id = UUID() | |
| } | |
| private var people = [ | |
| Person(givenName: "Juan", familyName: "Chavez", emailAddress: "juanchavez@icloud.com"), |
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 | |
| extension Bundle { | |
| var buildNumber: String { | |
| return infoDictionary?["CFBundleVersion"] as! String | |
| } | |
| } | |
| struct ContentView: View { | |
| var body: some View { |
NewerOlder