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
// | |
// TimePicker.swift | |
// | |
// Created by Tobias Stikvoort on 16/11/2021. | |
// | |
import SwiftUI | |
import UIKit | |
struct TimePicker: UIViewRepresentable { |
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
// | |
// LottieView.swift | |
// | |
// Created by Mathijs Bernson on 27/10/2021. | |
// | |
import SwiftUI | |
import Lottie | |
struct LottieView: UIViewRepresentable { |
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
// | |
// Snow.swift | |
// | |
// Created by Mathijs Bernson on 05/12/2021. | |
// | |
import UIKit | |
import SwiftUI | |
/// A transparent view that displays falling snow on top of itself. |
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 Spinner: UIViewRepresentable { | |
let style: UIActivityIndicatorView.Style | |
@State var animating: Bool = true | |
func makeUIView(context: Context) -> UIActivityIndicatorView { | |
UIActivityIndicatorView(style: style) | |
} |
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 | |
/// View modifier that constrains the width of a view to be no bigger than the readable width. | |
struct ReadableContentWidth: ViewModifier { | |
private let measureViewController = UIViewController() | |
@State private var orientation: UIDeviceOrientation = UIDevice.current.orientation | |
func body(content: Content) -> some View { | |
content |
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
- id: '1613375678079' | |
alias: Ask to start cleaning | |
trigger: | |
- platform: zone | |
entity_id: person.mathijs | |
zone: zone.home | |
event: leave | |
condition: | |
# I added this step in the UI, don't know how to find the device_id otherwise | |
# - condition: device |
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 bash | |
# formatting.sh - Automatically formats Swift files that have changed before committing. | |
DIFF_FILTER="ACMR" # Only format files that have been added, copied, modified or renamed. | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=$DIFF_FILTER "*.swift") | |
NOT_STAGED_FILES=$(git diff --name-only --diff-filter=$DIFF_FILTER "*.swift") | |
# Skip formatting for partially staged files. This is done by subtracting any files that git also considers unstaged from the list. | |
FILES_TO_FORMAT=($(comm -23 <(printf "%s\n" "${STAGED_FILES[@]}" | sort) <(printf "%s\n" "${NOT_STAGED_FILES[@]}" | sort))) |
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 ruby | |
XCODE_PATH = File.expand_path(File.join(`xcode-select -p`.chomp, '../..')) | |
def open_cmd(pattern) | |
files = Dir.glob(pattern) | |
`open -a "#{XCODE_PATH}" "#{files.first}"` and exit if files.count == 1 | |
end | |
open_cmd '*.xcworkspace' |
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
<?php | |
// Configuration | |
$source_file = 'Theme.swift'; | |
$output_asset_catalog = 'MyApp/Resources/Colors.xcassets'; | |
// | |
function mkdir_if_not_exists($directory) { | |
if (!is_dir($directory)) { |
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 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 |