This file contains 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 CoreLocation | |
{ | |
private let locationManager = CLLocationManager() | |
@Published var authorisationStatus: CLAuthorizationStatus = .notDetermined | |
@Published private(set) var userLocation: UserLocation? | |
private let merchantProvider: MerchantProtocol | |
var permissionStatus: LocationStatus { | |
switch authorisationStatus { |
This file contains 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 CryptoKit | |
enum FileCache { | |
// Write data to the cache file with the given URL | |
static func write(_ url: URL, data: Data) -> Void { | |
// Get the cache directory URL for the current user | |
if let fileManager = try? FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true) { | |
// Generate a unique file name for the cache file based on the URL hash |
This file contains 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 | |
let json = """ | |
[ | |
{ | |
"id": 1, | |
"name": "Watermarking photos with ImageMagick, Vapor 3 and Swift on macOS and Linux", | |
"type": "articles", | |
"photo": "https://mikemikina.com/assets/imagemagick-vapor-3/watermarked-photo.png", | |
"tags": ["Tutorial", "Vapor"] |
This file contains 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
let json = """ | |
[ | |
{ | |
"id": 1, | |
"name": "Any vs. AnyObject in Swift", | |
"type": "articles" | |
}, | |
{ | |
"id": 2, | |
"name": "New Apple silicon", |
This file contains 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 | |
//VOICI LA LISTE DES ETHNIES ET TRIBUS PAR TERRITOIRE DE LA RDC, UN ARTICLE RETROUVÉ AU MUSEE DE TERVUREN EN BELGIQUE (LES BANYAMULENGE, 𝑫𝑬𝑺 𝑹𝑾𝑨𝑵𝑫𝑨𝑰𝑺, N'Y FIGURENT PAS )* | |
// | |
//Recherchez aussi la vôtre... | |
//Ethnies/Tribus/Territoire* | |
//Patrice Emery Lumumba avait prédit : « l’histoire du Congo sera écrite par les congolais eux-mêmes ». | |
//Bravo à nos historiens et chefs coutumiers qui devraient vulgariser ce texte afin de sortir notre progéniture de l'ignorance. | |
//Le Chercheur !!!! | |
// Check output at: https://gist.github.com/cedricbahirwe/13cbeee55ff10dfc39f56940aa8b82ea |
This file contains 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
[ | |
{ | |
"key": 1, | |
"ethnie": "Abandiya", | |
"tribues": [ | |
"Aketi", | |
"Bondo", | |
"Buta" | |
] | |
}, |
This file contains 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 | |
var prereqsCourses = [ | |
("Software Design", "Algorithms"), | |
("Foundations of Computer Science", "Operating Systems"), | |
("Computer Networks", "Computer Architecture"), | |
("Computer Architecture", "Software Design"), | |
("Algorithms", "Foundations of Computer Science"), | |
("Data Structures", "Computer Networks") | |
] |
This file contains 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
// | |
// ContentView.swift | |
// SwiftUIPlayground | |
// | |
// Created by BJ Homer on 4/26/21. | |
// | |
import SwiftUI | |
This file contains 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
// | |
// CanvasView.swift | |
// MyiOS15 | |
// | |
// Created by Cédric Bahirwe on 14/06/2021. | |
// | |
import SwiftUI | |
let someSymbols = Array(repeating: Symbol("image1"), count: 80) + Array(repeating: Symbol("image2"), count: 50) |
This file contains 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 | |
class Book { | |
let name: String | |
let authorName: String | |
let year: Int | |
let price: Double | |
let isbn: String | |
init(name: String, authorName: String, year: Int, price: Double, isbn: String) { |