Skip to content

Instantly share code, notes, and snippets.

@nurikk
nurikk / remove_bg.py
Created February 3, 2024 21:59
Remove background from images using rembg
import logging
import rembg
from tqdm.contrib.concurrent import process_map
import os
import pathlib
def filter_files(files: list[pathlib.Path], target_suffix: str):
files_map = set(files)

About

Enable expresslrs ble joystic on any switch. It will save your time if you're flying in sym a lot and have bunch of unused switches on your radio.

Installation

  1. Copy script to /SCRIPTS/FUNCTIONS/ble.lua
  2. Create global function on any channel you want and select Lua Script and select ble
  3. Have fun! :)
@nurikk
nurikk / blocklist.txt
Last active April 18, 2023 19:56
lg tv pihole list
0.0.0.0 snu.lge.com
0.0.0.0 su.lge.com
0.0.0.0 su-ssl.lge.com
0.0.0.0 snu-ssl.lge.com
0.0.0.0 snu-dev.lge.com
0.0.0.0 su-dev.lge.com
0.0.0.0 nsu.lge.com
"""
This implementation demonstrates how to
perform topological sort, which yields
a linear ordering of the vertices of a
graph. Example considered is that of
inter-dependent jobs.
Input: List of jobs and list of dependencies
Output: A valid order in which jobs can be
completed
Let j be the number of jobs and d the number
@nurikk
nurikk / extension.js
Created June 29, 2021 06:02
Extension
const {
Socket
} = require('net');
//Kitchen Yeelight
const kitchenLight = {
host: '192.168.1.19',
port: 55443
};
const {
Socket
} = require('net');
//Kitchen Yeelight
const kitchenLight = {
host: '192.168.1.19',
port: 55443,
};
{
"type": "composite",
"name":"device_config",
"features": [
{"type":"numeric","name":"alarm","access":"rw"},
{"type":"numeric","name":"threshold","access":"rw"},
{"type":"numeric","name":"foo","access":"rw"},
{"type":"numeric","name":"saturation","access":"rw"},
]
}
@nurikk
nurikk / exposes.ts
Last active September 30, 2020 02:03
type LightFeatures = "state" | "brightness" | "color_temp" | "color_xy" | "color_hs";
interface Exposing {
endpoint?: string;
features: LightFeatures[] | string[];
}
class DeviceBuilder<T> {
@nurikk
nurikk / plan.md
Last active September 4, 2020 12:29
  1. Touchlink improvements: ⋅⋅⋅We need to add (3) new api's for Touchlink
 interface ScanResult {
     address: string | number;
 }

 interface Touchlink {
scanRequest(): Promise;
const {
fromZigbeeConverters,
toZigbeeConverters,
} = require('zigbee-herdsman-converters');
const ATTRID_MS_PRESSURE_MEASUREMENT_MEASURED_VALUE_HPA = 0x0200; // non standart attribute, max precision
const ZCL_DATATYPE_UINT32 = 0x23;
const bind = async (endpoint, target, clusters) => {
for (const cluster of clusters) {