Skip to content

Instantly share code, notes, and snippets.

View idcrook's full-sized avatar

David Crook idcrook

View GitHub Profile
@harb70
harb70 / How-to-Frigate-Apple-container.md
Last active March 1, 2026 16:33
Frigate 0.17 in Apple Container with Silicon detector

How-To: Frigate on Apple Container with Apple Silicon NPU

This guide explains how to install Frigate 0.17 on Mac with Apple Silicon using Apple Container (native alternative to Docker) with detection via the Neural Engine.

Prerequisites

  • Mac with Apple Silicon (M1/M2/M3/M4)
  • macOS 15+ (Sequoia) with Apple Container CLI
  • Python 3.11+
  • RTSP-compatible cameras
@pantherale0
pantherale0 / zigbee2mqtt_hue_dimmer_v2.yaml
Last active October 1, 2025 20:29 — forked from CrazyCoder/zigbee2mqtt_hue_dimmer_v2.yaml
Philips Hue Dimmer switch v2 (Zigbee2MQTT)
blueprint:
name: Philips Hue Dimmer switch v2 (Zigbee2MQTT)
description:
"Tested with Philips Hue Smart Wireless Dimmer Switch V2 (929002398602).
\n\n
To have different actions on short press and on hold (long press), use 'button release' (`*_press_release`) and 'button hold once' (`*_hold_once`) commands,
as 'press' (`*_press`) will always trigger before 'button hold' (`*_hold`).
\n\n
When you hold a button, 'button hold' (`*_hold`) command is repeated roughly once per second. This may not work as desired with actions like toggling light/switch.
If you want an action to run only once when the button hold action is registered, use 'button hold once' (`*_hold_once`). It's better than using 'button hold release'
@ViViDboarder
ViViDboarder / device_setup.py
Created September 24, 2024 22:47
WeMo device setup script for pywemo
from getpass import getpass
from pywemo import discovery
from pywemo.ouimeaux_device import Device
def discover() -> Device | None:
for device in discovery.discover_devices():
print(device)
if input("y/N? ").lower() == "y":
@samphonic
samphonic / gist:8c1e9dc8ca90aa65ff915262b4ed95d9
Created September 14, 2024 20:24
Govee H6052 to ESPHome
Important notes:
- To enter flash/download mode, connect TX2 to GND while plugging in USB-UART adapter, release once plugged in.
- Board type is `generic-rtl8710bn-2mb-468k`
- Limited space means removing API encryption is needed for default ESPHome config to work (probably more optimization to be done there)
- Use Itchiptool to backup firmware before doing anything.
- Download firmware from ESPHome dashboard "manual" install option and use Itchiptool to upload to board (couldn't get ESPHome to connect)
@gruber
gruber / Split Tabs to New Window.scpt
Last active December 1, 2025 22:56
An AppleScript for Safari to move all tabs in the frontmost window, from the current tab to the rightmost (last) tab, to a new window.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
Original script: John Gruber (https://daringfireball.net/linked/2023/12/05/an-applescript-for-safari-split-tabs-to-new-window)
Much more elegant version: Leon Cowle (https://github.com/leoncowle)
Even more elegant version: https://stackoverflow.com/questions/54066100/applescript-to-split-safari-tabs-into-new-window/54089865#54089865
Worth a warning: "moving" tabs with this script doesn't actually move them like
drag-and-drop does. The tabs "moved" by this script will reload in the new window,
@CrazyCoder
CrazyCoder / zigbee2mqtt_hue_dimmer_v2.yaml
Last active October 24, 2025 10:37
Philips Hue Dimmer switch v2 (Zigbee2MQTT)
blueprint:
name: Philips Hue Dimmer switch v2 (Zigbee2MQTT)
description:
"Tested with Philips Hue Smart Wireless Dimmer Switch V2 (929002398602).
\n\n
To have different actions on short press and on hold (long press), use 'button release' (`*_press_release`) and 'button hold once' (`*_hold_once`) commands,
as 'press' (`*_press`) will always trigger before 'button hold' (`*_hold`).
\n\n
When you hold a button, 'button hold' (`*_hold`) command is repeated roughly once per second. This may not work as desired with actions like toggling light/switch.
If you want an action to run only once when the button hold action is registered, use 'button hold once' (`*_hold_once`). It's better than using 'button hold release'
@jasonsnell
jasonsnell / weatherkit-sampleproject.py
Last active January 10, 2025 05:47
WeatherKit API sample
#! /usr/bin/env python3
import time
import jwt
import json
import requests
from datetime import datetime
from collections import defaultdict
import matplotlib.pyplot as plt
@smittytone
smittytone / dlist.zsh
Last active September 12, 2022 18:48
Z Shell function for macOS which detects and lists USB-connected serial devices
# Add to your `.zshrc` file or use the function's contents as a script.
#
# With the former, add the function, restart your terminal, connect
# a USB serial device, eg. a Raspberry Pi Pico, and then enter `dlist`
# at the command line.
#
# You should see something like this:
# `/dev/cu.usbserial-01AB8E0B`
#
# If you have only one device attached, you can include the function's
@drewkerr
drewkerr / get-focus-mode.js
Last active January 23, 2026 16:57
Read the current Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
const app = Application.currentApplication()
app.includeStandardAdditions = true
function getJSON(path) {
const fullPath = path.replace(/^~/, app.pathTo('home folder'))
const contents = app.read(fullPath)
return JSON.parse(contents)
}
function run() {
@codebytes
codebytes / DevMachineSetup.ps1
Last active May 5, 2025 14:22
DevMachineSetup
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12