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
| let fetchOptions = PHFetchOptions() | |
| fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)] | |
| fetchOptions.predicate = NSPredicate(format: "creationDate > %@ AND creationDate < %@", | |
| Date.make(year: 2020, month: 08, day: 21, hour: 18, minute: 42)! as CVarArg, | |
| Date.make(year: 2020, month: 08, day: 21, hour: 18, minute: 44)! as CVarArg) | |
| fetchOptions.fetchLimit = 100 | |
| let assets = PHAsset.fetchAssets(with: .image, options: fetchOptions) |
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
| final class AppAssembly { | |
| // private service | |
| private lazy var healthcheckProvider: HealthcheckProvider = { HealthcheckService(executor: resolve()) }() | |
| private lazy var authProvider: AuthProvider = { AuthService() }() | |
| private lazy var reviewProvider: ReviewProvider = { ReviewService(executor: resolve()) }() | |
| private lazy var followProvider: FollowProvider = { FollowService(executor: resolve()) }() | |
| private lazy var visionProvider: VisionProvider = { VisionService() }() | |
| private lazy var classifyingModel: ClassifyingModel = { ClassifyingModelBayes() }() | |
| private lazy var appRouter: AppRouter = { AppRouter() }() | |
| private lazy var userProfileProvider: ProfileProvider = { ProfileService(executor: resolve(), |
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
| protocol ServicesAssemble { | |
| var eventBus: EventBusProvider { get } | |
| var userSession: UserSession { get } | |
| var appSettings: SettingsProvider { get } | |
| var location: LocationProvider { get } | |
| var mapImageGenerator: MapImageGenerator { get } | |
| var profile: UserProfileProvider { get } | |
| var chat: ChatProvider { get } | |
| } |
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 | |
| import os.log | |
| // MARK:- | |
| protocol LogHandler { | |
| func debug(_ msg: String, _ params: [String: Any]) | |
| func info(_ msg: String, _ params: [String: Any]) | |
| func error(_ msg: String, _ params: [String: Any]) | |
| func fatal(_ msg: String, _ params: [String: Any]) | |
| } |
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 os | |
| enum LogSubSystem { | |
| case app | |
| case api | |
| case firebase | |
| } | |
| class AppLogs { | |
| private static let appLog = Logger(subsystem: "com.my-app", category: "App") |
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
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: api-ingress | |
| namespace: default | |
| annotations: | |
| kubernetes.io/ingress.global-static-ip-name: my-ip-address | |
| networking.gke.io/managed-certificates: my-certificate | |
| spec: | |
| backend: |
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
| router := gin.New() | |
| router.GET("/", func(c *gin.Context) { | |
| result := gin.H{ | |
| "status": "green", | |
| } | |
| c.JSON(http.StatusOK, result) | |
| }) |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: api-deployment | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: api | |
| template: | |
| metadata: |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: api-deployment | |
| labels: | |
| app: api | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: location-deployment | |
| labels: | |
| app: location | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: |
NewerOlder