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 ( | |
"database/sql" | |
"github.com/DATA-DOG/go-sqlmock" | |
"context" | |
"database/sql" | |
"fmt" | |
entsql "entgo.io/ent/dialect/sql" | |
"yourproject.com/project/ent" |
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
/// Function that will take an Array of `[S3Uploadable]` objects and returns a publisher that will complete once all uploads are done. | |
/// - Parameter objects: An array of `S3Uploadable` objects | |
/// - Returns: An `AnyPublisher` that will publish the array of objects you passed in and a faileur type of `Never` | |
public func upload(uploadableObjects objects: [S3Uploadable]) -> AnyPublisher<[S3Uploadable], Error> { | |
//We will collect some Futures into an array | |
var futures: [Future<S3Uploadable, Error>] = [] | |
//Collect the futures | |
for object in objects { | |
let future = self.upload(objectToUpload: object) |
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
// This is a value (de|en)coder for the github.com/google/uuid UUID type. For best experience, register | |
// mongoRegistry to mongo client instance via options, e.g. | |
// clientOptions := options.Client().SetRegistry(mongoRegistry) | |
// | |
// Only BSON binary subtype 0x04 is supported. | |
// | |
// Use as you please | |
package repository | |
import ( |
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
// | |
// Created by https://quickplan.app on 2020/11/8. | |
// | |
import SwiftUI | |
/// Control if allow to dismiss the sheet by the user actions | |
/// - Drag down on the sheet on iPhone and iPad | |
/// - Tap outside the sheet on iPad | |
/// No impact to dismiss programatically (by calling "presentationMode.wrappedValue.dismiss()") |
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 | |
import Network | |
final class ViewModel: ObservableObject { | |
@Published var status: NWPath.Status = .satisfied | |
init() { | |
NWPathMonitor() | |
.publisher() | |
.map { $0.status } |
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
// | |
// UIViewExtensions.swift | |
// | |
// | |
import Foundation | |
import UIKit | |
extension UIView { | |
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
/* Cargo.toml | |
[package] | |
name = "sqlxx" | |
version = "0.1.0" | |
authors = ["Agus Susilo <[email protected]>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] |
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 | |
extension View { | |
func eraseToAnyView() -> AnyView { | |
AnyView(self) | |
} | |
} | |
struct SizePreferenceKey: PreferenceKey { | |
typealias Value = CGSize |
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
struct FloatingTextField: View { | |
let title: String | |
let text: Binding<String> | |
var body: some View { | |
VStack(alignment: .leading, spacing: 2) { | |
Text(title) | |
.font(.caption) | |
.foregroundColor(Color(.placeholderText)) | |
.opacity(text.wrappedValue.isEmpty ? 0 : 1) |
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 | |
import WebKit | |
struct ContentView: View { | |
@ObservedObject var webViewStateModel: WebViewStateModel = WebViewStateModel() | |
var body: some View { | |
NavigationView { | |
LoadingView(isShowing: .constant(webViewStateModel.loading)) { //loading logic taken from https://stackoverflow.com/a/56496896/9838937 | |
//Add onNavigationAction if callback needed |
NewerOlder