Skip to content

Instantly share code, notes, and snippets.

@adirburke
adirburke / send-camera-snapshot-when-event-type-detected.yaml
Last active July 14, 2023 06:31 — forked from mcinnes01/send-camera-snapshot-when-event-type-detected.yaml
Send a camera snapshot when motion event type is detected
blueprint:
name: Send a camera snapshot when motion event type is detected
description: 'This automation blueprint creates a camera snapshot if general motion or a specific motion event object is detected and sends a notification to your phone with the picture.'
domain: automation
input:
motion_sensor:
name: Motion sensor
description: The sensor which triggers the snapshot creation
selector:
entity:
@adirburke
adirburke / aerohive.md
Created November 28, 2022 01:50 — forked from samdoran/aerohive.md
Configuring Aerohive access points using the CLI

Aerohive

Initial setup

  1. Reset to factory defaults

     reset config bootstrap
     reset config
    
  2. Configure interfaces

@adirburke
adirburke / Postgres+Transaction.swift
Created January 16, 2020 01:34 — forked from MihaelIsaev/Postgres+Transaction.swift
Postgres transaction extension for Vapor4 and Fluent4
//
// Postgres+Transaction.swift
//
// Created by Mihael Isaev on 14.01.2020.
//
import Vapor
import FluentKit
import PostgresKit
// Enum Protocol
public protocol PostgresEnum: RawRepresentable, Codable, CaseIterable, PostgresDataConvertible {
static var name: String { get }
}
extension PostgresEnum {
static var name: String { String(describing: self).lowercased() }
}
@adirburke
adirburke / fluent4+automigration.swift
Created January 16, 2020 01:11 — forked from MihaelIsaev/fluent4+automigration.swift
Fluent4 model with automigration example (automigration like in Fluent3)
// configure.swift
func configure(_ app: Application) throws {
app.migrations.add(Todo(), to: .psql)
try app.migrator.setupIfNeeded().wait()
try app.migrator.prepareBatch().wait()
}
// Todo.swift
final class Todo: Model, Content {
@adirburke
adirburke / 1_Vapor+Proto.swift
Last active January 10, 2020 14:30 — forked from vzsg/1_Vapor+Proto.swift
Using SwiftProtobuf with Vapor 4
import Vapor
import SwiftProtobuf
import Foundation
extension ByteBuffer {
public func allData() -> Data {
return getData(at: 0, length: readableBytes) ?? Data()
}
}