Skip to content

Instantly share code, notes, and snippets.

@mckeed
mckeed / LoadView.swift
Created Aug 12, 2022
SwiftUI view that calls a load function and shows a `LoadingView: UIView` until the `isLoading` binding is changed to false, then displays its contents.
View LoadView.swift
import SwiftUI
typealias IsLoadingBool = Bool // To help remember which way the bool goes (false means ready to display)
protocol LoadedView {
func load() -> Binding<IsLoadingBool>
}
// LoadingView is an existing full-screen UIView in my codebase.
// This could be replaced by any custom View
@mckeed
mckeed / encrypto
Created Oct 15, 2015
Shell script for easy encrypting of folders using keybase (I'm not a shell script master so let me know if there's errors)
View encrypto
if [ -d "$2" ]; then
( set -x
tar -cz "$2" | keybase encrypt -bs $1 -o "$2".tgz.gpg
)
elif [ -f "$2" ]; then
( set -x
keybase encrypt -bs $1 $2
)
else
echo "Usage: encrypto keybaseuser path"
@mckeed
mckeed / aeon-multisensor-6.groovy
Last active May 15, 2016
Aeon Labs Multisensor 6 device handler
View aeon-multisensor-6.groovy
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@mckeed
mckeed / aeon-rgbw-bulb.groovy
Created Jul 17, 2015
Aeon Labs RGBW LED Bulb device handler
View aeon-rgbw-bulb.groovy
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@mckeed
mckeed / rgbw-light.groovy
Created Jul 17, 2015
Z-Wave RGBW Light device handler
View rgbw-light.groovy
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@mckeed
mckeed / aeon-siren-with-sound-cmds.groovy
Last active Oct 24, 2018
Aeon Siren w/sound commands
View aeon-siren-with-sound-cmds.groovy
/**
* Aeon Siren with Sound Commands + revert to default
*
* Author: SmartThings
* Date: 2014-07-15
*/
metadata {
definition (name: "Aeon Siren", namespace: "smartthings", author: "SmartThings") {
capability "Actuator"
capability "Alarm"
@mckeed
mckeed / accessory-switch.groovy
Created Nov 12, 2014
Z-Wave Accessory Switch SmartThings Device Type
View accessory-switch.groovy
metadata {
// Automatically generated. Make future change here.
definition (name: "Accessory Switch", namespace: "mckeed", author: "Duncan") {
capability "Switch"
capability "Switch Level"
capability "Sensor"
command "associate"
fingerprint deviceId: "0x12"
@mckeed
mckeed / ridiculously-automated-zwave-garage-door.groovy
Last active Mar 20, 2019
Ridiculously Automated Garage Door for GD00Z
View ridiculously-automated-zwave-garage-door.groovy
/**
* Ridiculously Automated Garage Door
*
* Author: SmartThings
*
* Monitors arrival and departure of car(s) and
*
* 1) opens door when car arrives,
* 2) closes door after car has departed (for N minutes),
* 3) opens door when car door motion is detected,
@mckeed
mckeed / zwave-garage-door.groovy
Last active Jul 17, 2016
Z-Wave Garage Door Opener device type handler
View zwave-garage-door.groovy
/**
* Z-Wave Garage Door Opener
*
* Copyright 2014 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mckeed
mckeed / intermatic-switch
Created Aug 1, 2014
Intermatic Switch SmartThings Device Type
View intermatic-switch
metadata {
// Automatically generated. Make future change here.
definition (name: "Intermatic Switch", namespace: "mckeed", author: "Duncan") {
capability "Actuator"
capability "Switch"
capability "Refresh"
capability "Sensor"
fingerprint inClusters: "0x25"
}