Skip to content

Instantly share code, notes, and snippets.

View saroar's full-sized avatar
🏠
Working from home

Saroar Khandoker saroar

🏠
Working from home
View GitHub Profile
import Foundation
import ComposableArchitecture
import LPGSharedModels
import BSON
import ComposableCoreLocation
import LocationReducer
import UserDefaultsClient
import SwiftUI
import NukeUI
public struct TabReducer: Reducer {
public enum Tab: Equatable { case swapToys, conversations, profile, settings }
public struct State: Equatable {
public var swaps: SwapsReducer.State
public var conversations: Conversations.State
public var profile: Profile.State
public var settings: Settings.State
public var isHidden = false
public func swapsHandler(
request: Request,
route: SwapsRoute
) async throws -> AsyncResponseEncodable {
switch route {
case .create(input: let input):
if request.loggedIn == false { throw Abort(.unauthorized) }
let ownerID = request.payload.user._id
let title = input.name
public struct AttachmentS3Client {
public let bucket: String
public let bucketWithEndpoint: String
public let awsS3: S3
private let awsClient: AWSClient
private let logger: Logger
public typealias UploadImageToS3Handler = @Sendable (
UIImage,
# ================================
# Build image
# ================================
FROM swift:5.9-jammy-slim
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y libsqlite3-dev nano \
&& rm -rf /var/lib/apt/lists/*
import json
import imaplib
import time
from enum import Enum
class ErrorType(Enum):
login_fail = 1
not_connected = 2
class EmailHandler:
import ComposableArchitecture
import CoreLocation
import ComposableCoreLocation
import MapKit
import AddaSharedModels
extension String: LocalizedError {
public var errorDescription: String? { return self }
}
GRNValidRegExpression
:
"^[0-9][0-9][0-9][0-9]-(LLG|NVIZ)-([0-9]{4}|[0-9]{5})$"
NonUKVIToupVASEnabled
:
false
VisaTokenRegExpression
:
"^[a-zA-Z]{12}$"
additionalAllocationCode
import Html
import Vapor
import VaporRouting
struct WebIndex {
var title: String
var rootRouter: RootRouterKey.Value
public init(
public func authenticationHandler(
request: Request,
route: AuthenticationRoute
) async throws -> AsyncResponseEncodable {
switch route {
case .loginViaEmailGet:
// original HTML https://stackblitz.com/edit/zbqcqg?file=index.html
return modalFormLogin()