Skip to content

Instantly share code, notes, and snippets.

View fabianfett's full-sized avatar

Fabian Fett fabianfett

View GitHub Profile
@fabianfett
fabianfett / git-read-only.md
Created November 8, 2021 12:42
Set git remote push url to read only
git remote set-url --push open-source "READ-ONLY"
@fabianfett
fabianfett / LambdaHandler+ExtrasJSON.swift
Last active November 14, 2020 22:43
Use the AWSLambdaRuntime with ExtrasJSON
import AWSLambdaRuntimeCore
import NIO
import ExtrasJSON
/// Implementation of a`ByteBuffer` to `In` decoding
public extension EventLoopLambdaHandler where In: Decodable {
func decode(buffer: ByteBuffer) throws -> In {
try decoder.decode(In.self, from: buffer)
}
}
@fabianfett
fabianfett / EventLoop+ParallelProcessing.swift
Last active March 30, 2020 17:08
Run a number of tasks in a SwiftNIO EventLoop
import NIO
extension EventLoop {
public func process<Input, Output>(
input: [Input],
parallel: Int,
process: @escaping (Input, EventLoop) -> EventLoopFuture<Output>)
-> EventLoopFuture<[Result<Output, Error>]>
{
-- test finished --
--- Finished tests for llbuild ---
--- Running tests for swiftpm ---
+ /home/ec2-user/swiftpm/Utilities/bootstrap --release --swiftc=/home/ec2-user/build/buildbot_linux/swift-linux-x86_64/bin/swiftc --sbt=/home/ec2-user/build/buildbot_linux/llbuild-linux-x86_64/bin/swift-build-tool --build=/home/ec2-user/build/buildbot_linux/swiftpm-linux-x86_64 --link-llbuild --llbuild-source-dir=/home/ec2-user/llbuild --llbuild-build-dir=/home/ec2-user/build/buildbot_linux/llbuild-linux-x86_64 --foundation=/home/ec2-user/build/buildbot_linux/foundation-linux-x86_64 --libdispatch-source-dir=/home/ec2-user/swift-corelibs-libdispatch --libdispatch-build-dir=/home/ec2-user/build/buildbot_linux/libdispatch-linux-x86_64 --xctest=/home/ec2-user/build/buildbot_linux/xctest-linux-x86_64 test --test-parallel
--- bootstrap: note: building runtime v4_2 target: PackageDescription4:
--- bootstrap: note: building runtime v4 target: PackageDescription4:
--- bootstrap: note: building stage1
--- bootstrap: note: buildin
@fabianfett
fabianfett / Change Xcode version in GitHub Actions
Created August 21, 2019 09:37
How to change the Xcode version in GitHub Actions
# Change Xcode version in GitHub Actions
As of today (2019-08-21) I haven't found any documentation on changing Xcode versions when
using GitHub actions. So I checked the applications folder and everything we need is
already there. 🤩
```
> ls -n /Applications/ | grep Xcode*
lrwxr-xr-x 1 0 80 30 Aug 2 19:31 Xcode.app -> /Applications/Xcode_10.2.1.app
drwxr-xr-x 3 501 20 96 Oct 20 2018 Xcode_10.1.app
@fabianfett
fabianfett / delete-containers.md
Last active October 28, 2016 15:56
Delete All Docker Containers

Delete all Containers

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Delete all Images

docker rmi -f $(docker images -q)