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 / gist:892b6e30b724b81a8a48
Created November 11, 2015 05:38
Linux machine to chromcast server
Following is taken from: https://plus.google.com/111475821387295047208/posts/KDEfS6S2hyk
-------------------------
How to turn your Linux machine into a Chromecast Server
Stream YouTube, Netflix, Hulu, Etc. from your smartphone or tablet onto your server or laptop. ...without buying Chromecast hardware...
Prerequisite- Install Google Chrome on your Desktop. Install Chromecast application onto your portable device.
@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 / grafana-power-usage-dashboard.json
Created October 18, 2019 00:53
grafana-power-usage-dashboard
{
"__inputs": [
{
"name": "DS_GOLIATH_INFLUXDB",
"label": "goliath influxdb",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
@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,"