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
blueprint: | |
name: Wake-up light alarm with sunrise effect | |
description: | |
"A wake-up light alarm with a brightness and color temperature sunrise | |
effect. Note: not manually executable!" | |
domain: automation | |
input: | |
light_entity: | |
name: Wake-up light entity | |
description: |
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
### | |
# See: https://code-chronicle.blogspot.com/2014/08/connect-usb-device-through-vagrant.html | |
# See: https://docs.oracle.com/cd/E97728_01/E97727/html/vboxmanage-usbfilter.html | |
# Assuming MacOS as the host OS, with Homebrew already installed: | |
# Install Vagrant and Virtualbox with Homebrew: | |
# brew cask install vagrant virtualbox virtualbox-extension-pack | |
# | |
# After installing Vagrant and Virtualbox, on the host machine, | |
# do: | |
# VBoxManage list usbhost |
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
--- | |
# This task list is intended to be imported by playbooks, before any | |
# other tasks are performed. It lets us determine whether the configured SSH | |
# port is available, and lets us fall back to the default port if necessary. | |
# | |
# The use case here is when a role in the playbook is configured to change the | |
# sshd port, but the first time the role is executed the host is still | |
# listening on the default port. With this check in place, we can fall back | |
# to the default port on the first run, and then on subsequent runs use the | |
# configured port. |
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
--- | |
# This task list is intended to be imported by playbooks, before any | |
# other tasks are performed. It lets us install Python 2 (needed by Ansible) | |
# before Ansible tries to call anything that would use it. | |
# | |
# Execute these tasks as the first thing in a playbook like so: | |
# - hosts: some-host-group | |
# gather_facts: false | |
# tasks: | |
# - import_tasks: _python_2_check.yml |
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
# This would install vagrant-aws, if it's not already installed | |
# And do nothing if it was already installed. | |
vagrant_plugin_install vagrant-aws |
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
fn main() { | |
//let some_value: Result<i32, &'static str> = Ok(12); | |
//let some_value: Result<i32, &'static str> = Err("METAL!"); | |
let some_value: Result<i32, &'static str> = Err("There was an error"); | |
match some_value { | |
Ok(value) => println!("got a value: {}", value), | |
Err("METAL!") => println!("a specific metal error occured"), | |
Err(x) => println!("an unknown error occurred: {}", x), | |
} | |
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
<?php | |
// --- Library classes that provide behaviors --- | |
/** | |
* In these examples: | |
* - The Controller needs a view renderer | |
* - The view renderer needs a Database and a Logger | |
* | |
* Note, that the interfaces aren't being defined here, just assume they're what you'd expect. | |
*/ |
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
<?php | |
/** | |
* The point of this demonstration is to show how easily multibyte strings can be mangled in PHP. | |
* | |
* A random 50-character multibyte string is generated, and then several string functions defined in | |
* $commands are eval()'ed and the output is shown. | |
* | |
* The point to notice is that the non-mb_* commands will have inaccurate or mangling behavior with | |
* multibyte strings. Also important to note is that if the mb_* functions' encoding doesn't match the | |
* encoding of the string, they will still likely have unintended behavior. |