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
# Put this in `.github/actions/auth-setup/action.yaml` | |
name: Setup correct ssh auth | |
description: Installs keys, configures .ssh/config | |
inputs: | |
spm-private-key: | |
required: true | |
description: The private key to pull private Swift packages | |
fastlane-match-private-key: | |
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
#!/usr/bin/env zsh | |
set -e | |
# This script compiles libssh2 from source for macOS, creating a universal xcframework that works for Intel (x86_64) and Apple Silicon (arm64). | |
# How to use it: download or clone libssh2. Put this script in the root of the repository and run it. | |
SDK=macosx | |
SDK_VERSION="14.0" |
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
// | |
// MACAddress.swift | |
// | |
// | |
// Created by Mathijs on 23/01/2024. | |
// | |
import Foundation | |
/// Model for a standard MAC (Media Access Control) address, which consists of 6 bytes |
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 zsh | |
set -e | |
# This script compiles OpenSSL from source for macOS, creating a universal xcframework that works for Intel (x86_64) and Apple Silicon (arm64). | |
# How to use it: download or clone OpenSSL. Put this script in the root of the repository and run it. | |
CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/ | |
CROSS_TOP=`xcode-select --print-path`/Platforms/MacOSX.platform/Developer | |
CROSS_SDK=MacOSX.sdk |
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 | |
extension View { | |
/// Presents an alert when an error is present. | |
func alert<E: Error>(_ titleKey: LocalizedStringKey, error: Binding<E?>, buttonTitleKey: LocalizedStringKey = "Oke") -> some View { | |
modifier(ErrorAlert(error: error, titleKey: titleKey, buttonTitleKey: buttonTitleKey)) | |
} | |
} | |
private struct ErrorAlert<E: Error>: ViewModifier { |
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 selected = "Foo" | |
var body: some View { | |
SegmentedControl(options: ["Foo", "Bar", "Baz"], selectedOption: $selected) { label in | |
Text(label) | |
} | |
} |
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
// How to use it: | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
RecordScreenButton() | |
} | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct Point { | |
int x; | |
int y; | |
} Point; | |
int main() { | |
int count = 2; |
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 | |
import PlaygroundSupport | |
import Foundation | |
struct MarkdownView: View { | |
var body: some View { | |
Text(try! AttributedString(markdown: "This is a **basic** _string_. Italic bits are red. All the **bold** bits are _coloured_ **green**! And [this is a link!](https://q42.nl/).", customBoldColor: .green, customItalicColor: .red)) | |
.font(.title) | |
} | |
} |
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
// | |
// ScrollViewWrapper.swift | |
// | |
// Created by Mathijs Bernson on 10/03/2022. | |
// Copyright © 2022 Q42. All rights reserved. | |
// | |
import SwiftUI | |
import UIKit |
NewerOlder