Skip to content

Instantly share code, notes, and snippets.

@jackphilippi
jackphilippi / geolocation-automation.ha.blueprint.yaml
Created June 25, 2024 16:01
HA Blueprint for geolocation trigger
blueprint:
name: Geolocation Trigger for HA
domain: automation
description:
This simple automation turns off specific defined lights when a given person has left home.
input:
person:
name: Person
description:
When the given Person has left the home zone, the given lights will turn off.
blueprint:
name: IKEA Rodret Remote for ZHA
description: >
## Control anything with IKEA RODRET Dimmer remote (v1.2)
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
Available controls:
- Press the **on** or **off** buttons
- Double press the **on** or **off** buttons (optional) in **Helper - Double press delay** interval. When disabled, there will be no delay for the simple press actions
import requests
response = requests.get('https://api.example.com/data')
data = response.json()
data <- read.csv("~/Desktop/ref.csv")
result <- list()
if (nrow(data) %% 2 == 1) {
stop("CSV file must have an even number of rows.")
}
for (i in seq(1, nrow(data), by=2)) {
row1 <- data[i,]
row2 <- data[i+1,]
@jackphilippi
jackphilippi / cloudSettings
Last active April 12, 2021 04:32
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-06-18T07:07:11.773Z","extensionVersion":"v3.4.3"}

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

const defaultAvailableCounters = [
'flying',
'first strike',
'deathtouch',
'hexproof',
'lifelink',
'menace',
'reach',
'trample',
'vigilance',
#include "SPI.h"
int DATA = 11;
int CLOCK = 13;
int LATCH = 5;
void setup() {
Serial.begin(115200);
SPI.begin();
}
@jackphilippi
jackphilippi / pre-request-jwt.js
Last active January 7, 2019 02:35 — forked from corbanb/pre-request-jwt.js
JWT tokenize - Postman Pre-Request Script
var header = {
alg: "HS256",
typ: "JWT"
};
var data = injectIAT({
userId: "<userID>",
username: "<user>",
email: "<email>",
displayName: "<displayName>",
using System.Net.Http;
// Create a new HTTP client which we will use to send the request
private static readonly HttpClient client = new HttpClient();
// Create a dictionary with the value(s) you want to send
var values = new Dictionary<string, string>
{
{ "firstNumber", 123 },
{ "secondNumber", 456 },