Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View denysdovhan's full-sized avatar
👨‍💻
Working for @wix

Denys Dovhan denysdovhan

👨‍💻
Working for @wix
View GitHub Profile
# based on: https://community.home-assistant.io/t/tuya-radiator-valve-ts0601-calibration-from-external-sensor-via-zigbee2mqtt/337991
# alternative: https://community.home-assistant.io/t/sync-trv-with-external-tempature-sensor/298024
blueprint:
name: Calibrate TRV temperature
description: Temperature calibration for Zigbee valve TS0601, according to external temperature sensor
domain: automation
input:
valve:
name: Valve

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () => x) {
hmarochos.kiev.ua##.mainPageAdvRightBlock
hmarochos.kiev.ua###donate
hmarochos.kiev.ua##.lybidbanner
hmarochos.kiev.ua###enhancedtextwidget-14
hmarochos.kiev.ua##.bannernews
hmarochos.kiev.ua###hmarochos_logo_bw
pravda.com.ua##.container_sub_adv_content
connection.id: my-network
connection.uuid: d667788a-27b8-403e-b369-087868ba0102
connection.stable-id: --
connection.type: 802-11-wireless
connection.interface-name: --
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.multi-connect: 0 (default)
connection.auth-retries: -1
System: HassOS 3.13 (armv7 / raspberrypi4)
Home Assistant Core: 0.109.6
Home Assistant Supervisor: 222
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
Log level is set to DEBUG
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Example: do stuff over the next 30+ mins that requires sudo here or there.
function wait() {
@denysdovhan
denysdovhan / async-prompt.zsh
Last active December 18, 2019 20:49
Async prompt examples for Spaceship ZSH (zsh-async is required: https://github.com/mafredri/zsh-async)
#!/usr/bin/env zsh
# zsh-async is required:
# https://github.com/mafredri/zsh-async
source $PWD/async.zsh
async_init
# cache variable
typeset -Ag prompt_data

Keybase proof

I hereby claim:

  • I am denysdovhan on github.
  • I am denysdovhan (https://keybase.io/denysdovhan) on keybase.
  • I have a public key ASAsVrM0k1lbh4HVegGJDnrOF7f6kfTjsncP0eSX55Taxwo

To claim this, I am signing this object:

@denysdovhan
denysdovhan / noncoercible.js
Created February 18, 2017 18:32 — forked from chicoxyzzy/noncoercible.js
Non-coercible objects
function nonCoercible(val) {
if (val == null) {
throw TypeError('nonCoercible shouldn\'t be called with null or undefined');
}
const res = Object(val);
res[Symbol.toPrimitive] = () => {
throw TypeError('Trying to coerce non-coercible object');
}
return res;
};
@denysdovhan
denysdovhan / gist:0080d1bdcf5a43d19265e3b7225618f1
Created September 13, 2016 20:58 — forked from aqualungdesign/gist:4612606
iterm / oh-my-zsh -> rm move to .trash
#add script to .oh-my-zsh/lib/functions.zsh
function rm () {
local path
for path in "$@"; do
# ignore any arguments
if [[ "$path" = -* ]]; then :
else
local dst=${path##*/}
# append the time if necessary