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
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
""" | |
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
<!-- | |
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
""" | |
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 |
NewerOlder