Skip to content

Instantly share code, notes, and snippets.

View blizzrdof77's full-sized avatar

Ben Wagner blizzrdof77

View GitHub Profile
@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 / 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 / JavaScript 'loadStyle' Dynamically
Created October 23, 2019 23:49
Load CSS stylesheet or insert raw CSS dynamically with JavaScript.
SDG = SDG || {};
SDG.loadStyle = function(cssSource, append) {
var append = typeof append === 'undefined' ? true : append,
external = !(cssSource.indexOf('{') > 0 && cssSource.indexOf('}') > 1),
newElem = external ? ((function() {
i = document.createElement('link');
i.rel = 'stylesheet';
i.href = cssSource;
i.type = 'text/css';
@blizzrdof77
blizzrdof77 / keybase.md
Created January 7, 2020 02:58
Keybase Proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@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 / 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 / new_env_var.sh
Created September 15, 2020 23:03
Create new environment variable & print assignment statement to your shell's '.rc' file
# -----------------------------------------
# Create new environment variable & print assignment statement to your shell's '.rc' file
#
# @1 = variable new
# @2 = variable definition
# @requires: '~/.zshrc' or '~/.bashrc'
# -----------------------------------------
function new_env_var {
local detected_shell="$(ps -o comm= -p $$)"
local rcfile=$(echo "${HOME}/.${detected_shell//-/}rc")
@blizzrdof77
blizzrdof77 / zha-lutron-aurora-smart-area-blueprint.yaml
Last active November 1, 2024 15:44 — 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 (v3.0)
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 / zha-lutron-aurora-expanded-blueprint.yaml
Created January 17, 2022 18:18
Blueprint for Lutron Aurora automations in ZHA (expanded)
blueprint:
name: ZHA - Lutron Aurora Dimmer Expanded v1.5
description: Control lights 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. Adjust the sensitivity if updates from the dimmer are being sent too quickly.
domain: automation
input:
remote:
name: Lutron Aurora Dimmer Switch
description: Lutron Aurora Z3-1BRL
selector:
device:
@blizzrdof77
blizzrdof77 / zha-area-based-ikea-symfonisk-rotary-button-lights.yaml
Last active January 21, 2025 16:29 — forked from seamus65/zha_symfonisk_remote_lights.yaml
Blueprint for Home Assistant | Zigbee IKEA Symfonisk sound controller (for lights) [ZHA]
blueprint:
name: ZHA - Area-Based IKEA Symfonisk Sound Controller Knob Light Dimmer
description: Control lights with an IKEA Symfonisk sound controller (the spinny ones).
You can set functions for single press, double press, and triple press (e.g., scenes or scripts).
Rotating adjusts brightness smoothly.
domain: automation
input:
remote:
name: Remote
description: IKEA Symfonisk controller to use