Skip to content

Instantly share code, notes, and snippets.

View mcwitt's full-sized avatar

Matt Wittmann mcwitt

View GitHub Profile
@sbyx
sbyx / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active July 16, 2024 10:32
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@MMesch
MMesch / robust_splines_sklearn.py
Last active July 6, 2023 23:04
Robust Spline Regression with Scikit-Learn
#!/usr/bin/env python
"""
Robust B-Spline regression with scikit-learn
"""
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as si
from sklearn.base import TransformerMixin
from sklearn.pipeline import make_pipeline
@msullivan
msullivan / MicroKanren.hs
Created February 26, 2015 22:54
MicroKanren (μKanren) in Haskell
import Control.Monad
type Var = Integer
type Subst = [(Var, Term)]
type State = (Subst, Integer)
type Program = State -> KList State
data Term = Atom String | Pair Term Term | Var Var deriving Show
-- Apply a substitution to the top level of a term