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). | |
SDK=macosx | |
SDK_VERSION="14.0" | |
# Set up a build directory |
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). | |
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 | |
ARCH="x86_64" # The x86_64 architecture preset also includes the ARM64 architecture. |
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
# esphome configuration for the TTGO T-Camera ESP32-WROVER-B | |
# https://www.aliexpress.com/item/TTGO-T-Camera-ESP32-WROVER-B-PSRAM-Camera-Module-ESP32-WROVER-OV2640-Camera-Module-0-96/32966036489.html | |
# I use this 3D-printed case for the device: | |
# https://www.thingiverse.com/thing:3540059 | |
esphome: | |
name: woonkamer | |
platform: ESP32 | |
board: esp32dev |
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
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 | |
import Foundation | |
struct MarkdownView: View { | |
var body: some View { | |
Text(try! AttributedString(markdown: "This is a **basic** _string_.", customBoldColor: .green)) | |
.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
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
CREATE DATABASE `php_mysqltest`; | |
CREATE TABLE `test` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`test_int` int(11) DEFAULT NULL, | |
`test_float` float DEFAULT NULL, | |
`test_string` varchar(40) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
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; |
NewerOlder