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 UIKit | |
extension CGAffineTransform { | |
static func flipVertical(height: CGFloat) -> Self { | |
CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: height) | |
} | |
} |
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
// | |
// MailComposeView.swift | |
// | |
// Created by Mathijs Bernson on 08/03/2022. | |
// Copyright © 2022 Q42. All rights reserved. | |
// | |
import SwiftUI | |
import MessageUI |
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 | |
public struct Q42: View { | |
private let bounds = CGRect(x: 0, y: 0, width: 333, height: 500) | |
public init() {} | |
private var balloon: some Shape { | |
Fit(path: Path("166.6 500 m 214.8 345.7 273 319 316.9 232.9 c 371.2 126.5 282.5 0 166.6 0 c 50.7 0 -37.9 126.5 16.4 232.9 c 60.2 319 118.4 345.7 166.6 500 c h")!, bounds: bounds) | |
} |
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
from random import randint | |
# Gooi de dobbelsteen | |
answer = randint(1, 6) | |
while True: | |
guess = int(input('Raad een getal tussen 1 en 6: ')) | |
if guess == answer: | |
print("Dat was het juiste antwoord!") | |
break |
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
// | |
// TimePicker.swift | |
// | |
// Created by Tobias Stikvoort on 16/11/2021. | |
// | |
import SwiftUI | |
import UIKit | |
struct TimePicker: UIViewRepresentable { |
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
// | |
// LottieView.swift | |
// | |
// Created by Mathijs Bernson on 27/10/2021. | |
// | |
import SwiftUI | |
import Lottie | |
struct LottieView: UIViewRepresentable { |
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
// | |
// 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 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 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 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 |