Skip to content

Instantly share code, notes, and snippets.

View bendauphinee's full-sized avatar

Ben Dauphinee bendauphinee

View GitHub Profile
@bendauphinee
bendauphinee / README.md
Last active June 30, 2021 01:43
Home Assistant: Repeating Chores List
@bendauphinee
bendauphinee / beacon.go
Created March 5, 2016 17:24
A golang HTTP beacon script, with debug
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
//https://github.com/davecgh/go-spew
//"go-spew/spew"
@bendauphinee
bendauphinee / heatsteps.php
Created April 11, 2014 14:19
This code can be used to generate heatmap blue to red color gradients. Blog: http://blog.bendauphinee.com/2011/12/php-heatmap-gradient-color-generator/
<?php
// Generate an array of color hex codes between a start and an end color
function heatSteps ($config) {
$config['colorStart'] = (isset($config['colorStart']) == true) ? hexdec($config['colorStart']) : 0xdee7f8;
$config['colorEnd'] = (isset($config['colorEnd']) == true) ? hexdec($config['colorEnd']) : 0xff0f15;
$config['colorSteps'] = (isset($config['colorSteps']) == true) ? $config['colorSteps'] : 10;
$config['colorStart'] = (($config['colorStart'] >= 0x000000) && ($config['colorStart'] <= 0xffffff)) ? $config['colorStart'] : 0x000000;
$config['colorEnd'] = (($config['colorEnd'] >= 0x000000) && ($config['colorEnd'] <= 0xffffff)) ? $config['colorEnd'] : 0xffffff;