Skip to content

Instantly share code, notes, and snippets.

View joogps's full-sized avatar
❤️‍🔥

João Pozzobon joogps

❤️‍🔥
View GitHub Profile
@joogps
joogps / InnerShadow.swift
Last active January 17, 2022 02:05
Inner shadows in SwiftUI
struct InnerShadow<S: InsettableShape>: View {
let shape: S
var color: Color
var thickness: CGFloat
var offset: CGSize
var blur: CGFloat
init(shape: S,
color: Color = .white.opacity(0.25),
thickness: CGFloat = 0.0,
@joogps
joogps / TextMask.swift
Created October 10, 2020 13:40
Quick and easy negative text label with colored background in SwiftUI
import SwiftUI
struct TextMask: View {
var body: some View {
Color.white
.frame(maxHeight: 30)
.mask(Text("Today")
.font(.system(size: 12, weight: .heavy))
.padding(.vertical, 7)
.padding(.horizontal, 15)
@joogps
joogps / automations.yaml
Last active July 16, 2023 13:33
Home Assistant automation for calling webostv.button on HomeKit Remote key presses
- alias: Call webostv.button on HomeKit Remote key presses
trigger:
- platform: event
event_type: homekit_tv_remote_key_pressed
event_data:
entity_id: media_player.living_room_tv
action:
- service: webostv.button
data_template:
entity_id: "{{ trigger.event.data['entity_id'] }}"