Skip to content

Instantly share code, notes, and snippets.

View mortenmoulder's full-sized avatar

Morten Lomholt Møller mortenmoulder

View GitHub Profile
@mortenmoulder
mortenmoulder / C# Domain Validator method.cs
Created September 12, 2018 07:41
Checks if a given domain is valid according to these tests
// This will make the following conditions true:
// 1) Does not match hostnames
// 2) Cannot start or end with a dot
// 3) Cannot start or end with a hyphen
// 4) Number 3 applies for the hostname as well
// 5) Two punctuations after each other is not allowed
// 6) Cannot be an IP address
// 7) Can only use the characters: [0-9A-Za-z], punctuations, and hyphens
/*
@mortenmoulder
mortenmoulder / Program.cs
Created December 28, 2021 14:36
Beregn lønningsdage ud fra årstal
/*
* Beregn lønningsdage ud fra et årstal
*
* Den tager højde for officielle banklukkedage,
* som kun kan påvirkes af Store bededag og Nytårsdag,
* da disse datoer kan lande på sidste hverdag på en måned,
* såsom Store bededag 2021 som er fredag d. 30. april
*/
using System.Globalization;
blueprint:
name: MULTI-ZIG-SW
description: Blueprint for controlling actions based on button presses of the MULTI-ZIG-SW.
domain: automation
input:
controller_entity:
name: MULTI-ZIG-SW Entity
description: The action sensor of the device to use for the automation.
default: ''
selector:
@mortenmoulder
mortenmoulder / QUAD-ZIG-SW.yaml
Created January 30, 2024 11:39
QUAD-ZIG-SW.yaml
blueprint:
name: QUAD-ZIG-SW
description: Blueprint for controlling actions based on button presses of the QUAD-ZIG-SW.
domain: automation
input:
controller_entity:
name: QUAD-ZIG-SW Entity
description: The action sensor of the device to use for the automation.
default: ''
selector: