Skip to content

Instantly share code, notes, and snippets.

View csrui's full-sized avatar
🏠
Working from home

Rui Sardinha csrui

🏠
Working from home
View GitHub Profile
@cliffordp
cliffordp / functions.php
Last active September 13, 2017 03:36
Recurring events in wp-admin: only display first (parent) occurrence in list of Events (i.e. hide child recurring events)
<?php
/*
* Recurring events in wp-admin: only display first (parent) occurrence in list of Events
* (i.e. hide child recurring events)
*
* From https://theeventscalendar.com/knowledgebase/hide-recurring-event-instances-in-admin/
* - https://gist.github.com/cliffordp/81f23a207ab483c9e7c6d910f9b29c0a
* 2016-07-04 Barry shared this snippet from a previous customer's own/shared customization
*
@mtask
mtask / ublocaldns.txt
Created August 19, 2017 09:38
Disable local dns ubuntu
Source: https://askubuntu.com/questions/907246/how-to-disable-systemd-resolved-in-ubuntu
Disable the systemd-resolved service and stop it:
sudo systemctl disable systemd-resolved.service
sudo service systemd-resolved stop
Put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:
dns=default
Delete the symlink /etc/resolv.conf
@ciotlosm
ciotlosm / Readme.md
Last active February 5, 2024 15:04
Kiosk mode for lovelace

Kiosk mode

Installation

Add kiosk.js file with the content below to your www folder in config.

Like any other custom script, use ui-lovelace.yaml resources section to reference the kiosk.js file.

Make sure you add kiosk somewhere in your URL. You can use it in the id of your view or in the query string.

@doino-gretchenliev
doino-gretchenliev / configuration.yaml
Last active May 6, 2025 06:56
Home Assistant RADIUS authentication #home-assistant #homeassistant #radius #authentication #python
homeassistant:
auth_providers:
- type: command_line
command: "/config/auth/radius-auth.sh"
meta: true
@jazzyisj
jazzyisj / package_unavailable_entities.yaml
Last active November 10, 2024 14:38
Unavailable Sensor Detection and Notification
#######################################################################################################################
# The Unavailable Entities Sensor Package has been moved to it's own repository!
# https://github.com/jazzyisj/unavailable-entities-sensor
#######################################################################################################################
@sbyx
sbyx / notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml
Last active April 28, 2025 12:54
Home Assistant Blueprint: Notify or do something when an appliance like a dishwasher or washing machine finishes
blueprint:
name: Appliance has finished
description: Do something when an appliance (like a washing machine or dishwasher)
has finished as detected by a power sensor.
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
@sbyx
sbyx / wake-up-light-alarm-with-sunrise-effect.yaml
Last active April 15, 2025 10:03
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.
@warrenp11
warrenp11 / hexadecimal-regex.md
Last active September 26, 2022 10:57
Hexadecimal Color Code Validation Using Regular Expression

Regex Tutorial: Validating a Hexadecimal Color Code

The following documentation will attempt to explain the components of regular expressions (regex) and how they are used for many purposes, one of which is to validate a hexadecimal color code.

Summary

The following regex is used when validating a hexadecimal color code:

    /^#?([0-9a-f]{6}|[0-9a-f]{3})$/i