Skip to content

Instantly share code, notes, and snippets.

View dolby360's full-sized avatar
👾
Contact me and let's collaborate

Dolev Ben Aharon dolby360

👾
Contact me and let's collaborate
  • Israel
View GitHub Profile
@thomasloven
thomasloven / my-custom-card.js
Last active June 12, 2025 12:04
Simplest custom card
// Simplest possible custom card
// Does nothing. Doesn't look like anything
class MyCustomCard extends HTMLElement {
setConfig(config) {
// The config object contains the configuration specified by the user in ui-lovelace.yaml
// for your card.
// It will minimally contain:
// config.type = "custom:my-custom-card"
@nlm
nlm / macaddr.py
Created May 12, 2017 09:31
mac address <=> integer conversions in python
import re
def mac_to_int(mac):
res = re.match('^((?:(?:[0-9a-f]{2}):){5}[0-9a-f]{2})$', mac.lower())
if res is None:
raise ValueError('invalid mac address')
return int(res.group(0).replace(':', ''), 16)
def int_to_mac(macint):
if type(macint) != int:
@bodokaiser
bodokaiser / pool.c
Last active July 3, 2023 13:42
Simplistic thread pool implementation with pthread and libuv QUEUE
#include "queue.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#define THREADS 3
/**
* Task queue.