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
# Subquery that finds user data, happens for every resource request | |
# Also takes (and decodes) flash message from get parameters | |
eval $meta { | |
set_unescape_uri $flash $arg_flash; | |
postgres_pass database; | |
postgres_output json; | |
postgres_query "SELECT 'user name' as biggles, nullif('$flash', '') as flash"; | |
postgres_rewrite GET no_rows 403; | |
} |
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
var values = []; | |
var open = 0; | |
var value | |
var character; | |
for (a in $r.args) { | |
// sort params in array | |
for (n = 0; n < values.length; n++) { |
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
#include <stdio.h> | |
#include <string.h> | |
int array_push_sorted(char *array[128], int size, char *string, int length) { | |
int j, k; | |
char *old; | |
for (j = 0; j < size; j++ ) { | |
old = array[j]; | |
int i = 0; |
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/nginx/ngx_http_js_module.c Thu Apr 14 18:23:09 2016 +0300 | |
+++ b/nginx/ngx_http_js_module.c Wed May 04 16:46:03 2016 +0800 | |
@@ -95,6 +95,8 @@ | |
njs_value_t *value, void *obj, uintptr_t data); | |
static njs_ret_t ngx_http_js_ext_get_remote_address(njs_vm_t *vm, | |
njs_value_t *value, void *obj, uintptr_t data); | |
+static njs_ret_t ngx_http_js_ext_get_var(njs_vm_t *vm, | |
+ njs_value_t *value, void *obj, uintptr_t data); | |
static njs_ret_t ngx_http_js_ext_get_header_in(njs_vm_t *vm, njs_value_t *value, | |
void *obj, uintptr_t data); |
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
-- Example of a postgre-driven immutable versioned and validated models | |
DROP TABLE orders CASCADE; | |
CREATE TABLE orders( | |
id serial, -- Serial ID | |
root_id integer, -- ID of a first version | |
parent_id integer, -- ID of a previous version | |
version integer, -- Version number | |
errors jsonb, -- Results of validation |
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
decoration: | |
connector: | |
optional: true | |
$ii: | |
Y_inversion: | |
inverted: | |
place: [['graphical'], ['end']] | |
uninverted: | |
place: [['graphical'], ['start']] |
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
[ | |
[ | |
{ | |
"method": "openGroup", | |
"arguments": [ | |
"options", | |
578.255 | |
], | |
"uid": "d4" | |
} |
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
{ | |
"Y_width": { | |
"narrow": { | |
"$class": [ | |
"narrow" | |
] | |
}, | |
"half": { | |
"$class": [ | |
"half" |
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
expectations = ($, result, block, page) -> | |
return unless result | |
for property, value of result | |
if property == 'textual' | |
if block.text | |
$.expect(block).to.have.a('text') | |
else | |
$.expect(block).to.have.a('description') | |
else if property == 'type' |
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
module.exports = | |
Y_width: require('../../shared/stacks/branches/width') | |
Y_height: require('../../shared/stacks/branches/height') | |
h_emphasis: 'equal' | |
v_emphasis: 'center' | |
'direction': 'vertical' |