This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script aims to monitor the state of a circuit (open or closed) using an ESP32 and send real-time notifications | |
# to an ntfy.sh topic whenever the circuit's state changes. | |
# | |
# The WiFi credentials, notification topic, and configurable parameters such as the minimum notification interval are | |
# defined at the beginning of the script for easy customization. | |
# | |
# It uses interrupts for efficient state detection and sends HTTP POST requests to ntfy.sh without relying on external | |
# libraries, making it lightweight and straightforward. | |
# | |
# DISCLAIMER: Highly written with the help of an LLM for the sake of my precious time, but works nicely for my needs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Forked from: https://github.com/EPMatt/awesome-ha-blueprints/blob/9ee5920a3633c87bd8ee8713b83bbbf4705cc31d/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml | |
# Blueprint metadata | |
blueprint: | |
name: Controller - IKEA E2001/E2002 STYRBAR Remote control | |
description: | | |
# Controller - IKEA E2001/E2002 STYRBAR Remote control | |
Controller automation for executing any kind of action triggered by the provided IKEA E2001/E2002 STYRBAR Remote control. Allows to optionally loop an action on a button long press. | |
Supports deCONZ, ZHA, Zigbee2MQTT. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [[ $# != 2 ]]; then | |
echo "usage: cmprec <source1> <source2>" | |
exit 1 | |
fi | |
SOURCE1=$1 | |
SOURCE2=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kube_prompt() { | |
echo -n '\[\e[91m\]'$(kubectl config current-context)'\[\e[39m\]' | |
K8S_NS=$(kubectl config view --minify --output 'jsonpath={..namespace}') | |
if [[ ! -z $K8S_NS ]]; then | |
echo "|\[\e[0;32m\]$K8S_NS\[\e[39m\]" | |
fi | |
} | |
date_prompt() { | |
echo -e "$(date +%H:%M:%S).$(date +%N | cut -b1-2)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
git log --pretty=oneline --abbrev-commit | grep -oP '\(([^\)]*)\):' | sort | uniq | cut -c2- | sed 's/..$//' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const inputs = [ | |
'Bonjour monsieur Dupont ! Comment allez-vous ?..', | |
'Bonjour monsieur Dupont ! Comment allez-vous ?', | |
'Bonjour monsieur Dupond ! Comment allez-vous ?', | |
'test', | |
'testt', | |
'tests', | |
'a', | |
'A', | |
'B', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example from page 22 | |
const makrovChain = { | |
q: { | |
property: 0.7, | |
transitions: { | |
q: 0.7, | |
r: 0.1, | |
s: 0.2, | |
}, | |
emissions: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
echo "please choose a name for the certificate" | |
exit 1 | |
fi | |
openssl genrsa -out "$1.key" 4096 | |
openssl req -new -key "$1.key" -out "$1.req" | |
openssl x509 -req -in "$1.req" -CA rootCA.pem -CAkey rootCA.key -set_serial 101 -extensions client -days 500 -outform PEM -out "$1.cer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<div class="player"> | |
<canvas></canvas> | |
<video src="https://threejs.org/examples/textures/MaryOculus.webm" loop autoplay crossOrigin="" controls="false" style="display: none;"></video> | |
</div> | |
<canvas id="texture-canvas" width="500" height="100" style="display: none;"></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
INPUT="$1" | |
if [[ -z "$INPUT" ]]; then | |
echo 'Usage: proxify [filename.mlt]' | |
echo '(The current folder sould include a "raw" folder containing your raw footages in mp4 format)' | |
echo 'xpath is required for this tool to work' | |
exit | |
fi |
NewerOlder