Skip to content

Instantly share code, notes, and snippets.

View AtHeartEngineer's full-sized avatar
🏠
Working from home

AtHeartEngineer AtHeartEngineer

🏠
Working from home
View GitHub Profile
/**
* HVAC Auto Off
*
* Author: dianoga7@3dgo.net
* Date: 2013-07-21
*/
preferences {
section("Control") {
input("thermostat", "capability.thermostat", title: "Thermostat")
}
/**
* Nest Direct
*
* Author: dianoga7@3dgo.net
* Date: 2013-07-18
* Code: https://gist.github.com/Dianoga/6055918
*
* INSTALLATION
* =========================================
* 1) Create a new device type (https://graph.api.smartthings.com/ide/devices)
@AtHeartEngineer
AtHeartEngineer / print_table.py
Created July 7, 2018 01:20 — forked from jhcepas/print_table.py
nice table printing in python
def print_table(items, header=None, wrap=True, max_col_width=20, wrap_style="wrap", row_line=False, fix_col_width=False):
''' Prints a matrix of data as a human readable table. Matrix
should be a list of lists containing any type of values that can
be converted into text strings.
Two different column adjustment methods are supported through
the *wrap_style* argument:
wrap: it will wrap values to fit max_col_width (by extending cell height)
cut: it will strip values to max_col_width
@AtHeartEngineer
AtHeartEngineer / pprint_color.py
Created July 7, 2018 01:28 — forked from EdwardBetts/pprint_color.py
Python pprint with color syntax highlighting for the console
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import Terminal256Formatter
from pprint import pformat
def pprint_color(obj):
print highlight(pformat(obj), PythonLexer(), Terminal256Formatter())