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
'use strict' | |
const kClause = Symbol('kQueryClause') | |
const kPosition = Symbol('kQueryPosition') | |
const kWhere = Symbol('kQueryWhere') | |
const AND_BREAK = '\nAND ' | |
const ISNULL_EXP = /true|1/ | |
const SELECT_EXP = /^SELECT/i | |
const SELECT_REPLACEMENT = 'SELECT 1::SMALLINT as __id, ' |
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
'use strict' | |
const fastify = require('fastify') | |
const fluent = require('fluent-json-schema') | |
const WhizBang = fluent | |
.object() | |
.additionalProperties(false) | |
.id('whizbang') | |
.title('WhizBang') | |
.prop( |
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
WITH results AS ( | |
select | |
JSONB_ARRAY_ELEMENTS( | |
zdb.extract_the_agg_data( | |
index => 'spotlite_zdx' | |
, field => 'organization_id' | |
, response => arbitrary_agg::JSONB | |
) -> 'buckets' | |
) AS bucket | |
FROM zdb.arbitrary_agg( |
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
// inputs | |
{ | |
"a" : { | |
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
'use strict'; | |
function typeOf( item ){ | |
if(item === null) { | |
return 'null'; | |
} else if(item === undefined) { | |
return 'undefined'; | |
} | |
if( typeof item.$family == 'function' ){ |
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
<snippet> | |
<content><![CDATA[ | |
/** | |
* Description | |
* @constructor | |
* @alias module:$TM_FILENAME | |
* @param {TYPE} [param] | |
* @param {TYPE} [?param.val=1j] | |
* @example var x = new require('$TM_FILENAME'); | |
* @tutorial <tutorial-name> |
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
/*jshint node:true, laxcomma: true, smarttabs: true*/ | |
'use strict'; | |
/** | |
The conf package reads configurations options in an overriding fashion from a number of sources. In order of importance: | |
1. System level overrides | |
2. Command line arguments | |
3. Environment variables | |
4. A configuration file(s) | |
5. System specified defaults |
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
{ | |
"apps" : [{ | |
"name" : "Alice", | |
"script" : "/home/esatterwhite/dev/js/spiritshop-api/server.js", | |
"instances": 3, | |
"port":3001, | |
"env": { | |
"logger": "stdout", | |
"log__stdout__prettyPrint":0, | |
"NODE_PATH":"/home/esatterwhite/dev/js/spiritshop-api/packages" |
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
var zmq = require( "zmq" ) | |
, xpub // xpub to redistribute messages over known port | |
, xsub; // xsub to recieve incomming messaes | |
var xpub_url = 'tcp://0.0.0.0:9999' | |
var xsub_url = 'tcp://0.0.0.0:9998'; | |
var noop = function(){"use strict";} | |
xpub = zmq.socket( "xpub" ); | |
xsub = zmq.socket( "xsub" ); |
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
var zmq = require("zmq") | |
var pub = zmq.createSocket("pub") | |
pub.bind("tcp://127.0.0.1:19019"); | |
var x = 0 | |
setInterval(function(){ | |
console.log('publishing') | |
pub.send('foobar ' + ( ++x ) ) | |
},250) |
NewerOlder