Skip to content

Instantly share code, notes, and snippets.

View iceteabottle's full-sized avatar

Florian Symanowski iceteabottle

View GitHub Profile
@iceteabottle
iceteabottle / light-alarm.yml
Last active November 21, 2023 20:19
Light alarm aka Lichtwecker with Home Assistant
View light-alarm.yml
alias: "Lichtwecker"
description: "An automation for dimming a light from 0% up to 100% within 15 minutes"
action:
- type: turn_off
device_id: 738894a642dab1768d1ab51975b585f7
entity_id: 6c6e595ddc1b1bfb4027411381678295
domain: light
- repeat:
count: 20
sequence:
@iceteabottle
iceteabottle / install-cypress.sh
Last active May 31, 2023 16:57
[Install cypress only if the binary is missing] Check if cypress needs to be installed e.g. within the CI #cypress
View install-cypress.sh
#! /bin/sh
export CYPRESS_PACKAGE_VERSION=$(npx cypress --version --component package)
export CYPRESS_BINARY_VERSION=$(npx cypress --version --component binary)
echo "Cypress version:"
echo " - package: ${CYPRESS_PACKAGE_VERSION}"
echo " - binary: ${CYPRESS_BINARY_VERSION}"
if [[ "${CYPRESS_PACKAGE_VERSION}" != "${CYPRESS_BINARY_VERSION}" ]]; then
@iceteabottle
iceteabottle / README.md
Last active February 14, 2023 09:58
Lint only staged files #lint-staged #stylelint
View README.md

Lint only staged files (for eslint and stylelint)

If you only want to run esLint and stylelint really only for staged files. Don't forget to adjust the source paths.

@iceteabottle
iceteabottle / responsive-font-size.scss
Created March 9, 2020 16:08
Responsive font sizes #scss
View responsive-font-size.scss
$font-size-base: 16px !default;
@function strip-unit($value) {
@return $value / ($value * 0 + 1);
}
@function pxToRem($value) {
@return $value / $font-size-base * 1rem;
}
@iceteabottle
iceteabottle / key.js
Created September 26, 2017 15:16
form submit key return #js
View key.js
$(window).keydown(function (event) {
if (event.keyCode === 13 && $(':input').is(':focus')) {
event.preventDefault();
$('#next-step').trigger('click');
return false;
}
});