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
// | |
// AppDelegate.swift | |
// | |
// Copyright © 2024 Q42. All rights reserved. | |
// | |
import UIKit | |
import FirebaseCore | |
import FirebaseCrashlytics | |
import Factory |
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
esphome: | |
name: sha2017-badge | |
friendly_name: SHA2017 Badge | |
esp32: | |
board: esp32-pro | |
# Enable logging | |
logger: |
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 SwiftUI | |
import UIKit | |
struct PageControl<SelectionValue: Hashable>: UIViewRepresentable { | |
let items: [SelectionValue] | |
@Binding var selection: SelectionValue? | |
func makeUIView(context: Context) -> UIPageControl { | |
let pageControl = UIPageControl() | |
pageControl.pageIndicatorTintColor = .gray |
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
SIMULATOR_NAME="Custom Simulator" | |
DEVICE_ID="com.apple.CoreSimulator.SimDeviceType.iPhone-15" | |
RUNTIME_ID="com.apple.CoreSimulator.SimRuntime.iOS-17-2" | |
xcrun simctl create "$SIMULATOR_NAME" "$DEVICE_ID" "$RUNTIME_ID" |
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 Network | |
enum NetworkConnectivity { | |
case online | |
case offline | |
case unknown | |
} | |
let networkConnectivity = AsyncStream(NetworkConnectivity.self) { continuation in |
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
# 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 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/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 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
// | |
// 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 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/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 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 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 { |
NewerOlder