Skip to content

Instantly share code, notes, and snippets.

View thanpolas's full-sized avatar

Thanos Polychronakis thanpolas

View GitHub Profile

Keybase proof

I hereby claim:

  • I am thanpolas on github.
  • I am thanpolas (https://keybase.io/thanpolas) on keybase.
  • I have a public key ASCWHXwoj4IjP1CA1lp-qmFAHe3t_kebLO6KeNNWzK5XBgo

To claim this, I am signing this object:

@thanpolas
thanpolas / stdquote.js
Created June 6, 2021 09:34
Normalize all UTF quotes in Javascript
/**
* Will normalize quotes in a given string. There are many variations of quotes
* in the unicode character set, this function attempts to convert any variation
* of quote to the standard Quotation Mark - U+0022 Standard Universal: "
*
* @param {string} str The string to normalize
* @return {string} Normalized string.
* @see https://unicode-table.com/en/sets/quotation-marks/
*/
helpers.stdQuote = (str) => {
@thanpolas
thanpolas / motion-illuminance-v2.yaml
Last active August 27, 2023 13:06
Home Assistant Blueprint for automation that triggers on motion. Taking Illuminance and lights state as criteria for triggering
blueprint:
name: Motion-activated Light with illuminance v2
description: Turn on a light when motion is detected and illuminance is below a
set Lux level. Will use a configured scene instead of the previous light
setting and will not trigger when the lights are already on to avoid
overriding user defined lighting (i.e. you've set the lights to a certain
scene, this automation should not override this).
This automation is based on the work of Danielbook
https://gist.github.com/Danielbook/7814e7eb32e880b2d7c3fb5ba8430f4f
Blueprint version 1.0.0