Skip to content

Instantly share code, notes, and snippets.

View blizzrdof77's full-sized avatar

Ben Wagner blizzrdof77

View GitHub Profile
@blizzrdof77
blizzrdof77 / automatic-turn-off.yaml
Last active January 12, 2024 03:08 — forked from tdiekel/automatic-turn-off.yaml
Automatic light or switch turn off after time
blueprint:
name: Automatic light or switch turn off after timeout
description: >
Given a switchable entity, when it is turned on, it will automatically turn off after a set timeout period off after a certain period of time.
Based on:
- [Turn Off Light After Time](https://gist.github.com/JonTheNiceGuy/5ac636739165dd593030c0fed16eb618) by [JonTheNiceGuy](https://gist.github.com/JonTheNiceGuy)
- [Automatic light or switch turn off after time](https://gist.github.com/tdiekel/88ac0967cf6d3002aa91e65e3768eb45) by [tdiekel](https://gist.github.com/tdiekel)
domain: automation
input:
entity:
@blizzrdof77
blizzrdof77 / zha-ikea-symfonisk-rotary-button-lights.yaml
Last active January 26, 2022 06:39 — forked from seamus65/zha_symfonisk_remote_lights.yaml
Blueprint for Home Assistant | Zigbee IKEA Symfonisk sound controller (for lights) [ZHA]
blueprint:
name: ZHA - IKEA Symfonisk sound controller for lights
description: Control lights with an IKEA Symfonisk sound controller (the spinny ones). You can set functions for single press, double press and triple press (this allows you to assign a scene, script, etc). Rotating left/right will change the brightness smoothly of the selected light.
domain: automation
source_url: https://gist.github.com/blizzrdof77/ced20025d0328d4adce4c28e8d22cee5
input:
remote:
name: Remote
description: IKEA Symfonisk controller to use
selector:
@blizzrdof77
blizzrdof77 / zha-lutron-aurora-smart-area-blueprint.yaml
Last active September 12, 2023 19:33 — forked from bjpetit/zha_lutron_aurora_blueprint.yaml
HASS Blueprint | ZHA - Lutron Aurora Smart Area with Night-Light Dimmer
blueprint:
name: ZHA - Lutron Aurora Smart Area with Night-Light Dimmer (v2.1)
description: Control lights of a provided area with a Lutron Aurora Dimmer Pressing in the dimmer button will toggle between turning lights on to full brightness, and turning the lights off. Rotating the dimmer will increase and decrease the light brightness. Also supports late-night light groups.
domain: automation
source_url: https://gist.github.com/blizzrdof77/a0d048e58b8462748017e081bf3b9099
input:
remote:
name: Lutron Aurora Dimmer Switch
description: Lutron Aurora Z3-1BRL
selector:
@blizzrdof77
blizzrdof77 / open-in-finder.sh
Last active April 6, 2020 06:41 — forked from haifengkao/open_finder_tab.sh
A shell script to open a folder in Finder in a new tab or new window (if no window present)
#!/bin/bash
# open the current folder in Finder's tab
if [ -z "$1" ]; then
folder_name=$PWD
else
folder_name=$1
fi
@blizzrdof77
blizzrdof77 / fix-wordpress-permissions.sh
Last active March 9, 2020 19:39 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
@blizzrdof77
blizzrdof77 / manage-etc-hosts.sh
Created January 21, 2019 19:59 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/usr/bin/env bash
# Path to your hosts file
hostsFile="/etc/hosts"
# Default IP address for host
ip="127.0.0.1"
# Hostname to add/remove.
hostname="$2"
@blizzrdof77
blizzrdof77 / mysql.legacy-methods.php
Last active December 17, 2018 23:18 — forked from rubo77/fix_mysql.inc.php.md
Legacy PHP & MySQL Compatibility Functions - Replaces all MySQL functions with the corresponding MySQLi functions
<?php
/**
* Legacy PHP & MySQL Compatibility Functions
*/
/**
* replacement for all mysql functions
*
* Be aware, that this is just a workaround to fix-up some old code and the resulting project
* will be more vulnerable than if you use the recommended newer mysqli-functions instead.
@blizzrdof77
blizzrdof77 / slugify.js
Last active December 6, 2018 00:13 — forked from mathewbyrne/slugify.js
Javascript Slugify
/**
* Slugify
*
* @param string text
* @return string
*/
function cleanSlug(text) {
return (
text.toString().toLowerCase()
.replace(/\s+/g, '-') /* Replace spaces with - */
@blizzrdof77
blizzrdof77 / http-redirect-target.php
Created November 29, 2018 19:52
Get HTTP redirect destination for a URL in PHP
<?php
// FOLLOW A SINGLE REDIRECT:
// This makes a single request and reads the "Location" header to determine the
// destination. It doesn't check if that location is valid or not.
function get_redirect_target($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
@blizzrdof77
blizzrdof77 / json_storage.js
Created September 17, 2018 16:24 — forked from danott/json_storage.js
Override localStorage and sessionStorage's getter and setter function to allow for objects/arrays to be stored as well.
/* json_storage.js
* @danott
* 26 APR 2011
*
* Building on a thread from Stack Overflow, override localStorage and sessionStorage's
* getter and setter functions to allow for storing objects and arrays.
*
* Original thread:
* http://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage
*/