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
# Capture entire matched URL | |
( | |
# Optional: only allow some network protocols | |
# URL protocol and a colon followed by 2 slashes | |
(?: | |
(?: | |
http|https|ftp | |
):\\/\\/ | |
)? |
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
-- Debian packages nginx-extras, lua-zlib required | |
ngx.ctx.max_chunk_size = tonumber(ngx.var.max_chunk_size) | |
ngx.ctx.max_body_size = tonumber(ngx.var.max_body_size) | |
function create_error_response (code, description) | |
local message = string.format('{"status":400,"statusReason":"Bad Request","code":%d,"exception":"","description":"%s","message":"HTTP 400 Bad Request"}', code, description) | |
ngx.status = ngx.HTTP_BAD_REQUEST | |
ngx.header.content_type = "application/json" | |
ngx.say(message) |
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
-- Debian package nginx-extras and lzlib (https://github.com/LuaDist/lzlib) required | |
MAX_BUFFER_SIZE = 1048576 | |
function inflate_body (data) | |
local inflate = require("zlib").inflate(data) | |
local buffer = "" | |
repeat |
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
### Keybase proof | |
I hereby claim: | |
* I am davidcaste on github. | |
* I am dcastellanos (https://keybase.io/dcastellanos) on keybase. | |
* I have a public key ASDnqQ7mE6pLebdm74Z4fmlg36Ki14YQQSkuwQkWsh6RCwo | |
To claim this, I am signing this object: |
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
blueprint: | |
name: Door Sensor-activated Entities | |
description: | |
Turn entities on when a door is opened, off when a door is closed, | |
with optional delays | |
source_url: https://gist.github.com/davidcaste/a3b78c6b5412fbd93b9693ec620f4818 | |
domain: automation | |
input: | |
door_entity: | |
name: Door Sensor |