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 requests | |
from bs4 import BeautifulSoup | |
import csv | |
def fetch_reviews(company_name): | |
# Initialize variables | |
url = f"https://www.trustpilot.com/review/{company_name}" | |
reviews_list = [] | |
while url: |
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 | |
// https://www.nobelprize.org/prizes/economic-sciences/2020/summary/ | |
// All objects are auctioned simultaneously | |
// Bidder silently post their bids | |
// At the end of the first round the bidders can see all the bids and decide if they want to increase their bids or withraw their bid for thee next round | |
// The rounds keep going until we have a round where no more bids are placed or no more bids are withdrawn | |
enum LotAction { | |
case bid(offer: Double) |
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 Combine | |
import Resolver | |
class RESTFirestoreGalleryCollectionRepository: BaseCollectionRepository, GalleryCollectionRepository, ObservableObject { | |
let objectsPath: String = "objects" | |
let collectionsPath: String = "collections" | |
private static let imageProcessingQueue = DispatchQueue(label: "image-processing") | |
private var cancellables = Set<AnyCancellable>() |
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 | |
struct StringValue: Codable { | |
var stringValue: String? | |
} | |
struct IntValue: Codable { | |
var integerValue: String? | |
} |
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 SwiftUI | |
struct ContentView: View { | |
@State var show = false | |
var body: some View { | |
VStack{ | |
ZStack{ | |
Rectangle() | |
.fill(Color.white) |
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 Cocoa | |
fileprivate extension CodingUserInfoKey { | |
static let fragmentBoxedType = CodingUserInfoKey(rawValue: "CodingUserInfoKey.fragmentBoxedType")! | |
} | |
extension JSONDecoder { | |
private struct FragmentDecodingBox<T : Decodable> : Decodable { | |
var value: T | |
init(from decoder: Decoder) throws { |
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 Cocoa | |
fileprivate extension CodingUserInfoKey { | |
static let fragmentBoxedType = CodingUserInfoKey( | |
rawValue: "CodingUserInfoKey.fragmentBoxedType" | |
)! | |
} | |
extension JSONDecoder { | |
private struct FragmentDecodingBox<T : Decodable> : Decodable { |
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 Cocoa | |
struct Person: Codable { | |
let name: String | |
let age: Int | |
let friends: [Person]? | |
} | |
let person = Person(name: "Brad", age: 53, friends: nil) | |
protocol Identifiable { |
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 Cocoa | |
struct Person: Codable { | |
let name: String | |
let age: Int | |
let friends: [Person]? | |
} | |
let person = Person(name: "Brad", age: 53, friends: nil) | |
protocol Identifiable { |
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 Cocoa | |
protocol Identifiable { | |
var uuid: String { get set } | |
} | |
protocol Encryptable { | |
var encrypted: Bool { get } | |
func encrypt() |
NewerOlder