Skip to content

Instantly share code, notes, and snippets.

View skylord123's full-sized avatar

Skylar Sadlier skylord123

  • Skylar.Tech LLC
  • č̶̢ṙ̶̥̩e̴̮̞̓͝e̵̤͚͌̈́ṕ̵͈͖y̸̨͗̑ ̶̧̍͒y̴̭̰͒̾o̴̯̹͝u̸͖̾̚ ̷͇̊͆c̶͈͚͐à̸̛̙r̸͇͙̅e̷̹̓
View GitHub Profile
@skylord123
skylord123 / flow.json
Last active April 6, 2024 03:41
Node-RED integration with Torque Script
[{"id":"7b4f836b.c63e3c","type":"tcp out","z":"5fd187793239d604","name":"","host":"","port":"1881","beserver":"reply","base64":false,"end":false,"tls":"","x":560,"y":700,"wires":[]},{"id":"1993f5c2.4a154a","type":"tcp in","z":"5fd187793239d604","name":"","server":"server","host":"","port":"1881","datamode":"stream","datatype":"utf8","newline":"\\n\\n\\n","topic":"","trim":false,"base64":false,"tls":"","x":160,"y":580,"wires":[["d461697586d0556c"]]},{"id":"4c02e612c942936e","type":"inject","z":"5fd187793239d604","name":"Example data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"commandToServer|action","payloadType":"str","x":190,"y":740,"wires":[["ccbe06d13f5d025c"]]},{"id":"ccbe06d13f5d025c","type":"function","z":"5fd187793239d604","name":"append newline","func":"msg.payload += \"\\n\";\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":700,"wires":[["7b4f836b.c63e3c"]]},{"id":"7
@skylord123
skylord123 / classes.md
Created March 19, 2024 02:26
Age Of Time console functions and classes dump

dumpConsoleClasses();

==>dumpConsoleClasses();
class  SimObject {
  public:
   virtual void setName() {}
   virtual string getName() {}
   virtual string getClassName() {}
@skylord123
skylord123 / README.md
Last active February 28, 2024 03:28
Node-RED node to convert markdown to HTML for Matrix

Node-RED mark2html for matrix

This is taken from matrix-react-sdk on Feb 27, 2024. The idea is to generate markdown as close to Element as possible. The code was converted from TypeScript to JavaScript so it could be easily used inside a Node-RED function node.

Simply import the contents of flow.json using the hamburger menu in Node-RED.

The function node takes a msg.payload does the conversion then gives you back a new msg.payload property out to the first output. If there is an error it routes to the second output with msg.payload being the error message.

image

@skylord123
skylord123 / README.md
Last active January 5, 2024 04:16
Delete YouTube comments

Created this to make deleting my history easier. I tried at first deleting them all at once but the website would only delete a few and stop. Because of this I added a timeout of 4 seconds between each deletion which works great and prevents them from over-queueing. Also added a console.log statement so you can see the progress.

  1. Copy the contents of code.js
  2. Go to https://www.youtube.com/feed/history/comment_history
  3. Hold down Page Down button until you reach the end of the history
  4. Open developer console (can open from hamburger menu or pressing F12 in Windows)
  5. Paste the code into the console and run it (you may have to right click and hit "Force Paste")
@skylord123
skylord123 / gist:434a97ba513287046731b9e07b6e506a
Created August 25, 2023 16:24
Node-RED flow to auto restart Neolink when camera stream fails
[{"id":"d1ad8db0c33b93c1","type":"http in","z":"582717cf.467f78","name":"","url":"/xeoma/problem-detector","method":"post","upload":false,"swaggerDoc":"","x":290,"y":3000,"wires":[["3dbd5c276585c1c7"]]},{"id":"3dbd5c276585c1c7","type":"function","z":"582717cf.467f78","name":"Parse pieces","func":"msg.matches = /^(.+) ([^\\s]+) (\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}) (.+)$/gm.exec(msg.payload.report);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":3040,"wires":[["09c6b6d133b1891c","47d6268561b58ae4"]]},{"id":"09c6b6d133b1891c","type":"debug","z":"582717cf.467f78","name":"debug 78","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":3040,"wires":[]},{"id":"47d6268561b58ae4","type":"switch","z":"582717cf.467f78","name":"is Neolink camera","property":"matches[1]","propertyType":"msg","rules":[{"t":"regex","v":"Driveway|Front Yard Door|Back Yard","vt":"str","case":true}],"ch
@skylord123
skylord123 / esphome_config.yaml
Last active July 16, 2022 01:27
Wiegand ESP32-POE config
esphome:
name: west_warehouse_access_control
platform: ESP32
board: esp32-poe
includes:
- custom_components/wiegand_device/wiegand_device.h
ethernet:
use_address: west_warehouse_access_control
type: LAN8720
@skylord123
skylord123 / wiegand_device.h
Created June 8, 2021 21:45
My edits for ESPHOME Wiegand
#include "esphome.h"
#include <sstream>
/**
* Wiegand Reader Custom Device
*
* Copied from https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino
* Implemented by Greg Doerr (https://github.com/gdoerr)
*
* In my example, hooked to an Olimex ESP32-POE device connected to a Retekess H1EM-W
@skylord123
skylord123 / flow.json
Created January 20, 2020 22:44
Hue remote disabling input_boolean in Home Assistant from Node-RED
[{"id":"f984031f.c223d","type":"hue-switch","z":"ff717302.0c688","name":"Living room switch","bridge":"d2b1d65b.cbe438","sensorid":"6","x":290,"y":3680,"wires":[["229b2298.8b45fe","65985f7.4e331a"]]},{"id":"65985f7.4e331a","type":"switch","z":"ff717302.0c688","name":"Off button","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"Off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":500,"y":3720,"wires":[["ffb041d6.1476d"]]},{"id":"229b2298.8b45fe","type":"switch","z":"ff717302.0c688","name":"On button","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"On","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":500,"y":3660,"wires":[["fe8a3935.8a63d8"]]},{"id":"fe8a3935.8a63d8","type":"switch","z":"ff717302.0c688","name":"action","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"holded","vt":"str"},{"t":"eq","v":"short released","vt":"str"},{"t":"eq","v":"long released","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"
@skylord123
skylord123 / skylar.tech.conf
Last active November 16, 2019 22:56
Ghost blog letsencrypt example for skylar.tech
# I used to redirect all traffic to https but that broke
# letsencrypt validation because it needs to run on http.
#server {
# listen 80;
# server_name skylar.tech;
# return 301 https://$host$request_uri;
#}
server {
listen 80;
@skylord123
skylord123 / gist:0cf2d2e3c558b3c928be3bd242ebf4b7
Created October 23, 2019 01:48
Node-RED flow only fire on payload changes
[{"id":"59ea6981.ad14b8","type":"mqtt in","z":"582717cf.467f78","name":"","topic":"some/input/channel","qos":"2","datatype":"auto","broker":"5a59e251.9e1d4c","x":1110,"y":260,"wires":[["fe4cd5f9.d74f98"]]},{"id":"577b26e7.fcf1c8","type":"change","z":"582717cf.467f78","name":"","rules":[{"t":"set","p":"someinput_last_value","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":260,"wires":[["e47f530b.00cea"]]},{"id":"fe4cd5f9.d74f98","type":"switch","z":"582717cf.467f78","name":"","property":"someinput_last_value","propertyType":"flow","rules":[{"t":"neq","v":"payload","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1270,"y":260,"wires":[["577b26e7.fcf1c8"]]},{"id":"5a59e251.9e1d4c","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.10","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]