Skip to content

Instantly share code, notes, and snippets.

@franortiz
franortiz / tz3000_cayepv1a.py
Last active April 8, 2025 17:40
zigpy quirk for TS011F Circuit Breaker * Tongou TO-Q-SY2-JZT and others
"""TS011F Circuit Breaker * Tongou TO-Q-SY2-JZT."""
"""Supports HA 2024.11"""
from typing import Any, Optional, Union
import logging
import enum
from struct import (iter_unpack, pack)
from zigpy.profiles import zgp, zha
from zigpy.quirks.v2 import (
@gabcoh
gabcoh / cmdline_converter.py
Last active December 17, 2019 20:57 — forked from haakov/cmdline_converter.py
Standalone GNU Radio XML -> YAML block converter script
#
# Short script for converting GNU Radio XML blocks to YAML blocks
# without having to start GRC
#
# Please note that this program _WILL_ overwrite files.
#
# How to use:
# 1. Save this file to grc/converter/cmdline_converter.py
# 2. Navigate back to the GNU Radio project root
# 3. Run: python3 -m grc.converter.cmdline_converter [name.xml]
@sam0737
sam0737 / clock.html
Last active February 5, 2025 09:00
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@ZimbiX
ZimbiX / fix_pacman_duplicated_database_entry_errors.py
Created April 13, 2017 00:29
Fix Pacman "error: duplicated database entry '<package>'" for Arch Linux
#!/usr/bin/env python
import os,re, datetime
d = '/var/lib/pacman/local'
packages = os.listdir(d)
packages.sort()
packages.remove('ALPM_DB_VERSION')
pkgname_search = re.compile('^(.*?)-[0-9]')
@edgar-bonet
edgar-bonet / interpreter.ino
Last active January 8, 2025 22:09
Simple Arduino command line interpreter
/*
* interpreter.ino: Simple Arduino command line interpreter.
*
* This is intended solely as a template for building richer,
* application-specific interpreters. Add your specific commands to the
* exec() function, and whatever you need to setup() and loop().
*
* Usage:
* Talk to it through the serial port at 9600/8N1. Commands should be
* terminated by CR (\r), answers are terminated by CRLF (\r\n). This
@nextrevision
nextrevision / deleteJenkinsJobs.groovy
Created December 3, 2015 17:30
Groovy script to delete all jenkins jobs that match a regex pattern
import jenkins.model.*
def matchedJobs = Jenkins.instance.items.findAll { job ->
job.name =~ /my_regex_here/
}
matchedJobs.each { job ->
println job.name
//job.delete()
}
@elieux
elieux / msys2-mirror.sh
Last active April 2, 2017 14:45
MSYS2 pacman repos mirroring script
#!/usr/bin/bash
ROOT="$(pwd)"
dl() {
local cookie="/tmp/pacman-mirror-cookie.txt"
touch "${cookie}"
local file
@ccbrown
ccbrown / DumpHex.c
Last active February 12, 2025 00:25
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];