This file contains hidden or 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: template | |
sensors: | |
front_door_status: | |
value_template: >- | |
{%- if is_state("sensor.front_door_lock_type", "19") -%} | |
{%- if is_state("sensor.front_door_lock_level", "1") -%} | |
Matt | |
{%- elif is_state("sensor.front_door_lock_level", "2") -%} | |
Mark |
This file contains hidden or 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
fun main() { | |
var allUnder = 0 | |
var anyOver = 0 | |
repeat(500_000) { | |
val boxes = (0 until 100).toList().shuffled() | |
if (allUnderFifty(boxes)) { | |
allUnder++ | |
} else { |
This file contains hidden or 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
struct Sanitizer<I: Iterator> { | |
iter: PeekMoreIterator<I>, | |
needle: Vec<I::Item>, | |
} | |
impl<I: Iterator> Sanitizer<I> | |
where | |
I::Item: PartialEq, | |
{ | |
fn new(haystack: I, needle: Vec<I::Item>) -> Self { |
This file contains hidden or 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
// How to use this? | |
// * Navigate to the first page of your "Digital Content -> Books" section. | |
// * Figure out where your kindle is in the list and update `deviceIndex` below. | |
// * Open up a dev console and paste all of this in. | |
// * Type `downloadAll(0);` into the dev console and hit enter. | |
// * Repeat the above step for each page of books. | |
// | |
// This is tested in latest Firefox, and will probably break the second Amazon | |
// changes anything on the pages used. |
OlderNewer