Skip to content

Instantly share code, notes, and snippets.

View hrosenbauer's full-sized avatar

Hannes Rosenbauer hrosenbauer

View GitHub Profile
alias: "[Washing] Done"
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_power
for:
hours: 0
minutes: 0
seconds: 0
above: "500"
@hrosenbauer
hrosenbauer / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active December 6, 2022 09:09 — forked from sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml
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').
@hrosenbauer
hrosenbauer / vaadin-grid.java
Created January 17, 2020 10:44
Vaadin Grid with lazy-loading, sorting and filter
grid.addColumn(Customer::getFirstName)
.setHeader("Firstname")
.setSortable(true)
.setSortProperty("first_name");
grid.addColumn(Customer::getLastName)
.setHeader("Lastname")
.setSortable(true)
.setSortProperty("last_name");
grid.addColumn(Customer::getStatus)
.setHeader("Status")
@hrosenbauer
hrosenbauer / profiles.json
Created July 29, 2019 08:38
Windows Terminal + Cygwin + Solarized Dark
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{c3dc362e-35b7-40ad-adae-a240cde43d27}",
"initialCols" : 150,
"initialRows" : 50,
"keybindings" :
[
{
@hrosenbauer
hrosenbauer / 0_dell_xps13_9360
Last active May 8, 2017 07:50
Dell XPS 13 9360 Ubuntu 16.04
Stock Ubuntu 16.04 installation
@hrosenbauer
hrosenbauer / newsfeed.jsx
Created January 12, 2015 14:30
React NewsFeed
// https://speakerdeck.com/pedronauck/reactjs-keep-simple-everything-can-be-a-component
var React = require('react');
var NewsTitle = React.createClass({
propTypes: {
title: React.PropTypes.object.isRequired
},
render: function () {
var createdAt = this.props.title.createdAt;
@hrosenbauer
hrosenbauer / rc.local
Created October 30, 2014 09:19
rc.local for samsung 900x4d
#!/bin/sh -e
# default brightness
echo 936 > /sys/class/backlight/intel_backlight/brightness
# sound powersaving
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
# device powersaving
for device in /sys/bus/pci/devices/*/ ; do
@hrosenbauer
hrosenbauer / adblock-via-hosts-file.md
Created May 14, 2014 13:08
adblock via hosts file

hosts files layout:

/etc/hosts		('compiled' version)
/etc/hosts.d/
/etc/hosts.d/adblock	(adblocking hosts file)
/etc/hosts.d/base	(original system hosts file)
/etc/hosts.d/dev	(work-related file for development)

.bashrc:

@hrosenbauer
hrosenbauer / alot.js
Created March 23, 2014 16:41
be more descriptive about numbers
function aLot(n, one, two, many) {
var s = n === 1 ? one : (n === 2 ? two : many);
return s.replace(/\{\}/g, n);
}
aLot(1, 'one link', 'two links', 'countless links ({})');
aLot(2, 'one link', 'two links', 'countless links ({})');
aLot(99, 'one link', 'two links', 'countless links ({})');
@hrosenbauer
hrosenbauer / .zsh_aliases
Created February 9, 2014 12:14
ZSH aliases
# commands
alias apt='sudo apt-get'
# stash
function stash() {
filename=$(basename "$2")
filename="${filename%.*}"
case "$1" in
compress) # compress & encrypt