Skip to content

Instantly share code, notes, and snippets.

View zazaulola's full-sized avatar
🏠
Working from home

zazaulola

🏠
Working from home
View GitHub Profile
@zazaulola
zazaulola / demo.ts
Created December 23, 2024 04:35 — forked from vedantroy/demo.ts
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from './proxy.ts';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);
@zazaulola
zazaulola / README.md
Created November 5, 2024 04:17 — forked from storm1er/README.md
Script for OBS Studio to publish session stats to MQTT broker with autodiscovery set up for Home Assistant

OBS MQTT Status to Home Assistant

Setup:

  1. Download script
  2. Install mqtt-wrapper pip install mqtt-wrapper
  3. Open OBS Studio
  4. In OBS Studio add a script (Tools -> Scripts)
  5. Configure script parameters (my base channel is homeassistant and my sensor name is obs, creating the path homeassistant/sensor/obs)

script_parameters

@zazaulola
zazaulola / SearchInTheShadows.js
Last active August 14, 2024 01:12 — forked from Spencer-Doak/SearchInTheShadows.js
Recursively find all shadow roots in a page.
/**
* Find all elements with openned ShadowRoots
*
* @param {Node} e - An element that we should search for ShadowRoots within.
* @returns {Array<Element>} Array of Elements that holds ShadowRoot
*/
const findRoots = (e = document.documentElement) =>
[e,...e.querySelectorAll('*')]
.filter(e => e.shadowRoot)
.flatMap(e => [e, ...findRoots(e.shadowRoot)]);
@zazaulola
zazaulola / LICENSE.txt
Last active August 25, 2021 17:20 — forked from diafygi/LICENSE.txt
Base58 Encoder/Decoder - slightly over 140 bytes, but still pretty useful
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE