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
name: update-benchmark-thresholds | |
on: | |
workflow_dispatch: | |
inputs: | |
# This will have to be an exhastive list of all benchmarks. | |
# If there is a benchmark name missing, just update this list and push. | |
benchmark: | |
type: choice | |
required: true |
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
name: benchmark | |
on: | |
workflow_dispatch: | |
pull_request: { types: [opened, reopened, synchronize] } | |
push: { branches: [main] } | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true |
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
/// PREREQUISITES: | |
/// Add https://github.com/pointfreeco/swift-dependencies as a dependency of your target, currently it looks like so: | |
/// `.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"),` | |
// MARK: '+DependencyValues.swift' | |
import Vapor | |
import Dependencies | |
extension DependencyValues { |
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
[2711/2755] Compiling GHHooksLambda Requester.swift | |
[2712/2755] Emitting module Penny | |
undefined reference to '[QueuedProposal]' | |
var queuedProposals: [QueuedProposal] = [] | |
^ | |
undefined reference to 'rotoco' | |
struct QueuedProposal: Codable { | |
^ | |
, Sendable | |
[2713/2773] Compiling Penny MainService.swift |
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
/* | |
Use Case: | |
@ComputedField(key: "someKey", onSet: { transfromValue($0) }) | |
var someVar: Foo | |
*/ | |
import FluentKit | |
extension Fields { |
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
extension Sequence { | |
/// Maps through the elements one by one, | |
/// executing the closure for each of them one at a time. | |
func asyncMap<T>( | |
_ closure: @Sendable (Element) async throws -> T | |
) async rethrows -> [T] { | |
var array: [T] = [] | |
array.reserveCapacity(self.underestimatedCount) |
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
# Read the whole file once, if you're going to use it. There are a few things you need to change. | |
# Disclaimer: | |
# I'm using a very similar code myself, but i'm not a Nginx expert, so use this at your own risk. | |
server { | |
server_name YOURDOMAIN.COM WWW.YOURDOMAIN.COM; | |
# Example: `server_name oauthbm.mahdibm.com www.oauthbm.mahdibm.com;` | |
root /path/to/NAME_OF_ARCHIVE.doccarchive; | |
# Example: `home/ubuntu/OAuthBM/OAuthBM.doccarchive;` |
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 | |
struct ContentView: View { | |
@State var progress: CGFloat = 0 /* 0 <= progress <= 1 */ | |
let radius: CGFloat = 150 | |
let lineWidth: CGFloat = 10 | |
let startAngle: Angle = .degrees(35) | |
let endAngle: Angle = .degrees(145) | |
var deltaArc: CGFloat { |
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
#!/usr/bin/env swift | |
import Foundation | |
// Drops caches if (freeRam / totalRam) < 0.2 | |
print("Program started") | |
let pipe = Pipe() | |
let free = Process() | |
free.executableURL = URL(fileURLWithPath: "/usr/bin/env") | |
free.arguments = ["free"] |
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 Foundation | |
//MARK: - EmptyInitializable | |
protocol EmptyInitializable { | |
init() | |
} | |
extension String: EmptyInitializable {} | |
extension Bool: EmptyInitializable {} | |
extension Int: EmptyInitializable {} |