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
#!/usr/bin/osascript | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Basecamp Assignments | |
# @raycast.mode silent | |
# Optional parameters: | |
# @raycast.icon https://basecamp.com/favicon-32x32.png |
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
// *********** Cacheable Protocols *********** // | |
protocol Cacheable: Codable { | |
var expirationDate: Date { get set } | |
} | |
protocol CacheableDriver { | |
func nuke(key: String) -> Future<Void> | |
func get<C: Codable>(key: String) -> Future<C?> | |
func set<C: Codable>(key: String, data: C) -> Future<Void> |
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
// An extension to replicate the same functionality from Vapor 3 with automatic content decoding: | |
import Foundation | |
import Vapor | |
/// A basic, closure-based `Responder`. | |
struct ContentBasicResponder<C: Content>: Responder { | |
/// The stored responder closure. | |
private let closure: (Request, C) throws -> EventLoopFuture<Response> | |
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 Vapor | |
struct GoogleCaptcha { | |
let client: Client | |
let secretKey: String | |
private let endpoint = "https://www.google.com/recaptcha/api/siteverify" | |
func validate(captchaResponse: String) throws -> Future<Bool> { | |
let requestData = GoogleCaptchaRequest(secret: secretKey, response: captchaResponse) |
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
04957561d6cb13e25840aad8d8fb0ac5d5b9674e443749b1163cc9dea94f14f1cef8ab392f7d08c9ba785caec069ceef3a82c6a6d87750004b1a7127cf2d9587dc |
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
class API { | |
static let apiKey = "test" | |
static let baseUrl = "" | |
enum Endpoint { | |
case login | |
case register | |
var endpoint: String { | |
switch self { |