Skip to content

Instantly share code, notes, and snippets.

View MorningZ's full-sized avatar

Stephen MorningZ

  • Central Florida
View GitHub Profile
@MorningZ
MorningZ / hubitat-mode-manager.json
Last active March 12, 2020 23:43
Hubitat Mode Manager
[
{
"id": "5a0c9da9.b21974",
"type": "tab",
"label": "Hubitat",
"disabled": false,
"info": ""
},
{
"id": "b322a460.966118",
@MorningZ
MorningZ / hubitat-base64-image-css.dashboard
Created January 28, 2020 04:29
Using base64 images to use in CSS
/*
https://www.base64-image.de/
https://community.hubitat.com/t/the-noobs-in-complete-guide-to-css-for-hubitat/30592/63?u=morningz
*/
#tile-2 .tile-primary > * { display: none; }
#tile-2 .tile-primary.open {
width: 100%;
background:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAABkCAYAAABKHuhiAAAKyWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUk1kWx9/3pYeEAKHX0JsgRSCAlNADKL2KSkgCCSXEhKBgRwZHcFQQEUFFwFERBccCyFgRxYpiQwWdIIOCMg4WREVlP2AJM7tnd8/+33nn++Xmvnvv+857OTcAkPEsoTAdVgAgQ5AlCvf3osXGxdNwvwMIGURkGLDYYiEjNDQYIJp5/l0fHyK+iO5ZTcb69+//qxQ5XDEbACgU4SSOmJ2B8ElkjrCFoiwAUPsRu+HyLOEkX0VYWYQUiHDvJKdM88gkJ00xGj3lExnujbA6AHgSiyVKAYBkhNhp2ewUJA7JB2EbAYcvQBj5DNzZPBYHYSQvmJORkTnJUoTNkv4SJ+VvMZNkMVmsFBlP72VKeB++WJjOyvk/X8f/Vka6ZCaHCTJJPFFAOPJE6oIepWUGyViQtDBkhvmcKf8p5kkComaYLfaOn2EOyydItjZ9YfAMJ/P9mLI4WczIGeaKfSNmWJQZLsuVLPJmzDBLNJtXkhYls/O4TFn8XF5kzAxn86MXzrA4LSJo1sdbZhdJwmX1cwX+XrN5/WR7zxD/Zb98pmxtFi8yQLZ31mz9XAFjNqY4VlYbh+vjO+sTJfMXZnnJcgnTQ2X+3HR/mV2cHSFbm4UcyNm1obJ3mMoKDJ1h4AO4IB0ZNBAB7IATsAWOiM0/i7ti8owC70xhjoifwsuiMZBb
@MorningZ
MorningZ / ikea-up-down-hubitat.groovy
Last active July 4, 2024 12:37
IKEA up/down button Hubitat driver that comes with FYRTUR blinds
/**
* Ikea Button
*
* Copyright 2018
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@MorningZ
MorningZ / adobe-io-token.vb
Last active January 8, 2020 18:03
Create Adobe.IO token via VB.NET
' What a maddening experience, but was able to get it working!
' The following functions will take your Adobe.IO service application settings and generate a token using JWT
' You first need to generate a JWT and then "exchange" this for a Bearer token. Your milage may vary
' but I created the JWT with an expiration date of 20 mins and then cached the Bearer token for 10 mins,
' this way I am using the HttpRuntime cache to handle "refreshing" the Bearer token.
'
' Notes:
' -- Adobe IO Console, create service applications here: https://console.adobe.io/
' -- Service Account Creation walkthrough
' https://www.adobe.io/authentication/auth-methods.html#!AdobeDocs/adobeio-auth/master/AuthenticationOverview/ServiceAccountIntegration.md
@MorningZ
MorningZ / myq_lite_hubitat_driver_code.groovy
Created November 19, 2019 22:29
Hubitat "myQ Lite" driver code (install 2nd)
/**
* -----------------------
* --- DEVICE HANDLER ----
* -----------------------
*
* MyQ Garage Door Opener
*
* Copyright 2019 Jason Mok/Brian Beaird/Barry Burke
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
@MorningZ
MorningZ / myq_lite_hubitat_app_code.groovy
Last active November 19, 2019 22:28
Hubitat "myQ Lite" app code (install 1st)
/**
* -----------------------
* ------ SMART APP ------
* -----------------------
*
* MyQ Lite
*
* Copyright 2019 Jason Mok/Brian Beaird/Barry Burke/RBoy Apps
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
@MorningZ
MorningZ / gmap_example.html
Created April 12, 2019 00:41
GMap plugin example
<script type="text/javascript">
var generate_maps = function() {
// By Address
$("<selector>").each(function() { by_address(this, "<address to show>"); });
// By Lat/Log
$("div[data-lat]").each(function() { by_latlong(this); });
};
@MorningZ
MorningZ / js_protos.js
Last active April 11, 2019 16:01
JavaScript prototypes
/* Prototypes that work against primitives */
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); };
String.prototype.contains = function(t) { return this.indexOf(t) >= 0 ? true : false; };
String.prototype.beginsWith = function(t, i) { if (i == false) { return (t == this.substring(0, t.length)); } else { return (t.toLowerCase() == this.substring(0, t.length).toLowerCase()); } };
String.prototype.startsWith = function(t, i) { if (i == false) { return (t == this.substring(0, t.length)); } else { return (t.toLowerCase() == this.substring(0, t.length).toLowerCase()); } };
String.prototype.endsWith = function(t, i) { if (i == false) { return (t == this.substring(this.length - t.length)); } else { return (t.toLowerCase() == this.substring(this.length - t.length).toLowerCase()); } };
String.prototype.format = function() {
var a = arguments;
if (a && a["0"] && a["0"] === "phone") {
var input = ("" + this).numbers();
@MorningZ
MorningZ / clean_word_paste.js
Last active March 22, 2019 18:04
Clean Word Paste
// Code
var CleanWord = {
"_swapCodes": new Array(8211, 8212, 8216, 8217, 8220, 8221, 8226, 8230),
"_swapStrings": new Array("--", "--", "'", "'", "\"", "\"", "*", "..."),
"Control": function (input) {
$(input).val(CleanWord.Text($(input).val(), false));
},
"Text": function (txt, log) {
var output = txt;
for (i = 0; i < CleanWord._swapCodes.length; i++) {
@MorningZ
MorningZ / FocusRSorg - Enahnce.txt
Last active October 9, 2018 18:34
Cleans up the "Active Threads" page of FocusRS.org. Pick and choose what threads to show/hide. Also changes the search in the navbar to use Google instead of the crappy vBulletin one.
/*
==========================
Compatible with:
==========================
- Desktop versions of Chrome, Firefox and Safari
==========================
Purpose:
==========================