This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Constructing a binary search tree from a BST preorder traversel in linear time. | |
Paulus Schoutsen, Feb 16 2014 | |
""" | |
import sys | |
MAX_INT = sys.maxint | |
MIN_INT = -sys.maxint - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Behavior to connect your NuclearJS app to Polymer. | |
Add key 'bindNuclear' to your property with as value a | |
valid NuclearJS getter. | |
Adapted from the NuclearJS ReactJS mix-in: | |
https://github.com/jordangarcia/nuclear-react-mixin | |
--> | |
<dom-module id='nuclear-example'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Sensor platform for Home Assistant that fetches data from the Things network. | |
Home Assistant: https://home-assistant.io | |
The Things Network: http://thethingsnetwork.org/ | |
To use: | |
Copy this file to <config>/custom_components/sensor/thingsnetwork.py | |
Add to <config>/configuration.yaml: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_virtual(): | |
""" Return if we run in a virtual environtment. """ | |
# Check supports venv && virtualenv | |
return (getattr(sys, 'base_prefix', sys.prefix) != sys.prefix or | |
hasattr(sys, 'real_prefix')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.slice.call(document.getElementsByClassName('js-branch-row')) | |
.filter(el => el.getElementsByClassName('state-merged').length > 0 || | |
el.getElementsByClassName('state-closed').length > 0 || | |
el.getElementsByClassName('count-ahead')[0].innerHTML == '0') | |
.forEach(el => el.getElementsByClassName('branch-delete')[0].click()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Support for MQTT lights. | |
For more details about this platform, please refer to the documentation at | |
https://home-assistant.io/components/light.mqtt/ | |
""" | |
import logging | |
from functools import partial | |
import homeassistant.components.mqtt as mqtt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copy this file to <config_dir>/example/sensor.py | |
Add to your configuration.yaml: | |
sensor: | |
platform: example | |
""" | |
from homeassistant.const import TEMP_CELSIUS | |
from homeassistant.helpers.entity import Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get ESP8266 going with Arduino IDE | |
// - https://github.com/esp8266/Arduino#installing-with-boards-manager | |
// Required libraries (sketch -> include library -> manage libraries) | |
// - PubSubClient by Nick ‘O Leary | |
// - DHT sensor library by Adafruit | |
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <DHT.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define wifi_ssid "YOUR_WIFI_NAME" | |
#define wifi_password "YOUR_WIFI_PASSWORD" | |
#define mqtt_server "MQTT_SERVER" | |
#define mqtt_user "MQTT_USER" | |
#define mqtt_password "MQTT_PASS" | |
#define ac_topic "device/study_room/ac" | |
#define temperature_topic "device/study_room/temperature" | |
#define humidity_topic "device/study_room/humidity" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer