Skip to content

Instantly share code, notes, and snippets.

@crusaderky
crusaderky / sunrise-wake-up.en.yaml
Created November 29, 2026 19:26
Wake-up Sunrise (Kelvin, smooth & smart) (EN)
blueprint:
name: Wake-up Sunrise (Kelvin, smooth & smart)
description: >
Modern alarm clock with a sunrise effect. Default: warm white (≈2200 K) → daylight white (≈6500 K),
automatically adjusted to the device limits. Optionally use an RGB color curve from start color to end color
instead of Kelvin. Future-proof thanks to color_temp_kelvin. For multiple lamps, select a light group.
domain: automation
input:
light_entity:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neon Arena</title>
<link rel="icon" href="data:image/x-icon;base64,">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #000; font-family: 'Segoe UI', system-ui, sans-serif; }
canvas { display: block; }
@crusaderky
crusaderky / AppArmor config for bwrap
Last active May 18, 2026 14:40
Bubblewrap for Claude and Pi
# /etc/apparmor.d/bwrap
# To load: sudo apparmor_parser -r /etc/apparmor.d/bwrap
abi <abi/4.0>,
include <tunables/global>
profile bwrap /usr/bin/bwrap flags=(unconfined) {
userns,
include if exists <local/bwrap>
}
@crusaderky
crusaderky / argcargvtest.py
Created July 30, 2025 09:25
SWIG_AsArgcArgv segfault
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.4.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
from . import _argcargvtest
@crusaderky
crusaderky / make_versioned_dataset.py
Created December 20, 2024 16:01
versioned-hdf5 demo dataset builder
import argparse
import h5py
import numpy as np
from versioned_hdf5 import VersionedHDF5File
def gen_string(rs, j, k, dt):
return (
rs.randint(ord("A"), ord("Z"), dt.itemsize * j * k, dtype="uint8")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / unravel_pickle.py
Created April 4, 2024 23:47
unravel_pickle
from pickle import PickleBuffer
def unravel_pickle(obj: object, seen: list[int] | None = None) -> Any:
if isinstance(obj, (int, float, complex, bytes, str, bool, type(None))):
return obj
if isinstance(obj, (bytearray, memoryview, PickleBuffer)):
return str(type(obj)), bytes(obj)
if callable(obj):
@crusaderky
crusaderky / tcp_bench.ipynb
Created November 1, 2023 13:57
dask/distributed#8318 - Speed up network transfer of small buffers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / DemoDay.ipynb
Created June 19, 2023 08:52
Dask Demo Day: Fine performance metrics and spans
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.