Skip to content

Instantly share code, notes, and snippets.

- id: '************'
alias: Christmas tree
trigger:
- entity_id: switch.sonoff8
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
@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.

@Jengas
Jengas / index.php
Last active March 26, 2024 21:40
Discord oauth2 example PHP
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', '1234567890');
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode');
@tomduijf
tomduijf / configuration.yaml
Last active February 20, 2024 23:57
Home Assistant configuration
#################################################################
## Main and component setup
#################################################################
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: [REDACTED]
longitude: [REDACTED]
# C for Celcius, F for Fahrenheit
@magnetikonline
magnetikonline / dumprequest.php
Last active April 30, 2024 08:01
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
@lagonnebula
lagonnebula / logs.class.php
Last active October 14, 2018 00:40
Get Players connected in your Starbound server. You can get Server Version, Who is online and Server status
<?php
/**
* a PHP class for checking server status and who is connected.
*
* @author MeuhMeuh starbound.meuhmeuh.fr
* @copyright (c) 2013, Jeremy Villemain
*/
class Logs{
private $etat;