create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| import Vapor | |
| public protocol FutureParameter { | |
| associatedtype ResolvedParameter | |
| static var routingSlug: String { get } | |
| static var parameter: PathComponent { get } | |
| static func resolveParameter(_ parameter: String, on app: Application) -> EventLoopFuture<ResolvedParameter> | |
| } |
| location = /apple-app-site-association { | |
| proxy_pass http://static.example.com/apple-app-site-association; | |
| proxy_hide_header Content-Type; | |
| add_header Content-Type "application/json"; | |
| } | |
| or | |
| location = apple-app-site-association { | |
| default_type application/json; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| // | |
| // Postgres+Transaction.swift | |
| // | |
| // Created by Mihael Isaev on 14.01.2020. | |
| // | |
| import Vapor | |
| import FluentKit | |
| import PostgresKit |
| // Enum Protocol | |
| public protocol PostgresEnum: RawRepresentable, Codable, CaseIterable, PostgresDataConvertible { | |
| static var name: String { get } | |
| } | |
| extension PostgresEnum { | |
| static var name: String { String(describing: self).lowercased() } | |
| } |
| import FluentKit | |
| import Vapor | |
| final class Todo: Model, Content { | |
| static let schema = "todos" | |
| @iID(key: "id", .uuid, .identifier(auto: false)) | |
| var id: UUID? | |
| @iField(key: "title", .string, .required) |
| // configure.swift | |
| func configure(_ app: Application) throws { | |
| app.migrations.add(Todo(), to: .psql) | |
| try app.migrator.setupIfNeeded().wait() | |
| try app.migrator.prepareBatch().wait() | |
| } | |
| // Todo.swift | |
| final class Todo: Model, Content { |
| import UIKit | |
| class CustomIntensityVisualEffectView: UIVisualEffectView { | |
| /// Create visual effect view with given effect and its intensity | |
| /// | |
| /// - Parameters: | |
| /// - effect: visual effect, eg UIBlurEffect(style: .dark) | |
| /// - intensity: custom intensity from 0.0 (no effect) to 1.0 (full effect) using linear scale | |
| init(effect: UIVisualEffect, intensity: CGFloat) { |
| import Vapor | |
| import SwifQL | |
| class AuthMiddleware: Middleware { | |
| /// Use it on your router like this | |
| /// ```swift | |
| /// let protectedRoute = router.grouped(AuthMiddleware()) | |
| /// ``` | |
| func respond(to request: Request, chainingTo next: Responder) throws -> Future<Response> { | |
| return try request.requireToken().flatMap { try next.respond(to: $0) } |
| // | |
| // Reflectable | |
| // | |
| // Copied from https://github.com/vapor/core | |
| // | |
| import Foundation | |
| import SwifQL | |
| import NIO |