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: Motion Lighting - Advanced | |
description: | |
"Turn on a light, switch, scene, script or group based on motion detection, | |
and low light level.\nThis blueprint uses helper entities you have to create yourself | |
for some input values, to be able to dynamically set limits. For instructions | |
on creating the helper entities take a look in the Home Assistant Community forum | |
topic: https://community.home-assistant.io/t/turn-on-light-switch-scene-or-script-based-on-motion-and-illuminance-more-conditions/257085\n\nRequired | |
entities:\n - Motion sensor (single sensor or group)\n - Target entity (light, | |
switch, scene* or script*)\n\n(*) If you select a scene or script as your target_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
A few blocks of .htaccess code to help improve your websites performance and/or functionality. I would recommend reading about each section and applying if required instead of applying everything. | |
The more code in your .htaccess the more your server needs to process BEFORE the HTML starts being served. | |
______________________ .htaccess starts after this line _________________________________ | |
## Optional - Allow cross-origin requests. ## | |
# http://enable-cors.org/ - http://www.w3.org/TR/cors/ | |
# https://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity |
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 | |
$eventName = $modx->event->name; | |
switch ($eventName) { | |
case 'OnLoadWebDocument' : | |
$output = $GLOBALS['code_content'] = $modx->resource->get('content'); | |
preg_match_all('/<pre.*?>(.*?)<\/pre>/ims', $output, $matches); | |
$i = 0; | |
foreach ($matches[1] as $key => $match) { | |
$output = str_replace($match, '~*code_' . $i . '*~', $output); |