Skip to content

Instantly share code, notes, and snippets.

@habnabit
habnabit / playground.rs
Last active September 28, 2017 02:57 — forked from anonymous/playground.rs
Rust code shared from the playground
use linux;
use log;
use core::fmt::Write;
use core::fmt;
use log::{LogRecord, LogLevel, LogMetadata};
#[derive(Default)]
struct DMesgLogger;
@habnabit
habnabit / playground.rs
Created July 2, 2018 03:45 — forked from rust-play/playground.rs
Code shared from the Rust Playground
let pipeline = framed_reader
.map(move |b| {
let message: proto::Message = bincode::deserialize(&b).unwrap();
let file;
let blocking_future;
match message {
proto::Message::Request(m) => {
file = m.file.clone();
if m.file == Path::new("/root/test/file").to_path_buf() {
blocking_future = poll_fn(move || {
"""Please, let me know which child is calling me: 'parent' ? """
class A:
"""This is a mixin class to share code for DRY"""
def __init__(self, var=None):
super().__init__()
self.override_me()
def override_me(self):
@habnabit
habnabit / wake-up-light-alarm-with-sunrise-effect.yaml
Last active December 24, 2022 18:30 — forked from sbyx/wake-up-light-alarm-with-sunrise-effect.yaml
Home Assistant Blueprint: Wake-up light alarm with sunrise effect
blueprint:
name: Wake-up light alarm with sunrise effect
description: 'A wake-up light alarm with a brightness and color temperature sunrise
effect. Note: Requires date_time_iso sensor in configuration, not manually executable!'
domain: automation
input:
light_entity:
name: Wake-up light entity
description: The light to control. Turning it off during the sunrise will keep
it off. Color temperature range is auto-detected.