Skip to content

Instantly share code, notes, and snippets.

View Inviz's full-sized avatar

Yaroslaff Fedin Inviz

View GitHub Profile
# 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;
}
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++) {
#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;
--- 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);
-- 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
decoration:
connector:
optional: true
$ii:
Y_inversion:
inverted:
place: [['graphical'], ['end']]
uninverted:
place: [['graphical'], ['start']]
[
[
{
"method": "openGroup",
"arguments": [
"options",
578.255
],
"uid": "d4"
}
{
"Y_width": {
"narrow": {
"$class": [
"narrow"
]
},
"half": {
"$class": [
"half"
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'
module.exports =
Y_width: require('../../shared/stacks/branches/width')
Y_height: require('../../shared/stacks/branches/height')
h_emphasis: 'equal'
v_emphasis: 'center'
'direction': 'vertical'