Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: Motion-activated Light (dual time profile + dual wait + lux + sensitivity)
description: >
Turn on lights on motion with two brightness profiles and two wait times
based on a time window (supports overnight). Optional ambient-lux guard,
sensor sensitivity control, transition, and cooldown.
domain: automation
input:
motion_entity:
blueprint:
name: Remote Light Control (ZHA) — Toggle+Dim (separate targets)
description: >
ZHA remote: short "on" uses time-based brightness; short "off" turns off.
Dimming (short/long) can target a different light/area/device.
domain: automation
input:
remote_device:
name: ZHA Remote
@jroehl
jroehl / README.md
Last active September 5, 2023 14:42

Bash script to delete all entries of a specific content type of a contentful space

Usage

bash <(curl -s https://gist.githubusercontent.com/jroehl/e96378b14cf35213bfdae060d965ec6f/raw/unpublishAndDelete.sh) "contentTypeId"

{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {
"AppDefinition": {
"additionalProperties": false,
"properties": {
"bundle": {
"$ref": "#/definitions/Link<\"AppBundle\">",
"description": "Link to an AppBundle"
@jroehl
jroehl / README.md
Last active November 22, 2019 10:12

Interactive bash script to open the sqlite database directory (core data) of a specific app installed in Xcode simulator

Needs jq to be installed
Needs xcrun to be installed (xcode-select --install)
Needs /usr/libexec/PlistBuddy to be installed (xcode-select --install)

Usage

. &lt;(curl -s https://gist.githubusercontent.com/jroehl/e5230754a95d7c243a3c6290668d94fb/raw/find-simulator-coredata.sh)

@jroehl
jroehl / README.md
Last active March 1, 2020 11:10
Bash script to create a billing report task in kanbanflow

Bash script to create a billing report task in kanbanflow

Needs jq >= 1.5

Usage

curl -s https://gist.githubusercontent.com/jroehl/8ba7eb7280278518a52889613dcc02d3/raw/create-billing-report.sh | bash -s "--month=1 --year=2020"

@jroehl
jroehl / regex.md
Created September 27, 2019 11:32
Some useful regexes.

import to require

import (.*) from (.*)[;]?$
const $1 = require($2);

export to module.exports

export ((?:async )?(?:function)*(?:class)* ([a-zA-Z0-9]+)[ ]?\([\s\S]*?\n}\n)
$1

Bash script to update the ddns entry of a namecheap domain

Needs yq (pip install yq) and dig to be installed

Usage

curl -s https://gist.githubusercontent.com/jroehl/25dcd6a35d5cf7809d3274439a1e6783/raw/update-ddns.sh | bash -s "host" "domain" "password"

@jroehl
jroehl / README.md
Last active June 13, 2018 12:54
Set the circleci environment variables with dynamic variables or default values

Bash script to set environment variables in circleci script

This script is useful if you want to set environment variables dynamically in circleci config.yml file. The environment variables used in this case are used for go-suitesync.

The env variable master_NSCONF_ACCOUNT will overwrite the NSCONF_ACCOUNT variable - if set!

Usage in a script

 curl -sL https://gist.github.com/jroehl/30d8c212babd5414ad921a298bebec87/raw/set-circleci-env.sh | bash
@jroehl
jroehl / README.md
Last active April 14, 2024 15:30
Download a github release, specified by version number

Bash script to download release from github

This script is useful if you want to download a release, specified by version number, unpack the tar file and smoke test the executable.

Usage in a script

  export RELEASE=0.0.1
  export REPO_OWNER=jroehl
 export REPO=go-suitesync