Skip to content

Instantly share code, notes, and snippets.

View kmplngj's full-sized avatar

Jan Kampling kmplngj

  • Münster, Germany
View GitHub Profile
@nikoheikkila
nikoheikkila / it.fish
Created May 19, 2022 16:55
Fish Shell: Interactive runner for your Taskfile tasks
# Example: `it -v`, then press <ENTER> to pick a single task, or <TAB> to select multiple tasks and then <ENTER>
function it -d 'Run Taskfile tasks interactively'
task $argv (\
task --list \
| cut -d ' ' -f2 \
| tail -n +2 \
| sed 's/://' \
| sort \
| fzf -m --reverse --preview 'task --summary {}' \
@grischard
grischard / hob2hood.yaml
Created July 14, 2021 10:16
Hob2Hood for esphome with four relays. Works with esphome 1.16.0, needs updating for more recent versions. Three push buttons: light, fan up, fan down. Four relays: light, fan 1, fan 2, fan 3.
substitutions:
device: smarthood
name: Smart Hood
reboot_timeout: 1h
update_interval: 60s
delayed_on_off: 20ms
pin_relay_lamp: D0
pin_relay_fan1: D3
pin_relay_fan2: D2
pin_relay_fan3: D1
@nriley
nriley / init.lua
Last active March 6, 2024 17:02
Hammerspoon script for ensuring Sidecar is active when iPad is plugged in (macOS 10.15; see comments for versions up to macOS 13)
hs.loadSpoon('SpoonInstall')
spoon.SpoonInstall.use_syncinstall = true
Install = spoon.SpoonInstall
log = hs.logger.new('init', 5)
-- function debugUI(msg, table)
-- log:d(msg)
-- log:d(hs.inspect(table))
-- end
@farmio
farmio / knx-relative-dimming-for-lights.yaml
Last active April 3, 2024 18:51
KNX - relative dimming for lights blueprint
blueprint:
name: KNX - relative dimming for lights
description: Controll Home Assistant Light entities from KNX switching and relative dimming (DPT 3.007) telegrams.
domain: automation
input:
target_lights:
name: Light
description: The lights that shall be controled.
selector:
target:
@paoloantinori
paoloantinori / 80-mount-usb-to-media-by-label.rules
Created December 21, 2020 16:19 — forked from eklex/80-mount-usb-to-media-by-label.rules
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@pichfl
pichfl / incidence.js
Last active December 7, 2020 12:31 — forked from kevinkub/incidence.js
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪 - Ich empfehle die Nutzung des Originals! https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664
// Forked from Keven Kub.
// See https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
const apiUrl = ({ longitude, latitude }) =>
`https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=GEN,cases7_per_100k&geometry=${longitude.toFixed(
3
)}%2C${latitude.toFixed(
3
)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`;
@eklex
eklex / 80-mount-usb-to-media-by-label.rules
Last active April 16, 2024 18:49
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active May 6, 2024 23:53
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active April 29, 2024 22:18
Docker Container Logging using Promtail
@aaronNGi
aaronNGi / newscript.sh
Created April 28, 2020 20:38
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts