- load a config
{
"collection" : "products",
"match" : { "language" : "de" },
"queueProperty" : "__mdbqb",
"cleanUpQueueProperty" : false,
/** | |
* chunk and dont be strict with length | |
* @param {*} text | |
* @param {*} chunkSize | |
* @returns | |
*/ | |
function chunk(text, chunkSize) { | |
let result = []; | |
let words = text.split(" "); |
[ | |
{ | |
"text": "Deutschland", | |
"value": "DE" | |
}, | |
{ | |
"text": "Österreich", | |
"value": "AT" | |
}, | |
{ |
import pipeline, { Middleware } from './pipeline'; | |
const step1: Middleware<any, any> = (req, res, next) => { | |
if (req.body) { | |
console.log(`STEP 1: \n req: ${JSON.stringify(req)}\n res: ${JSON.stringify(res)}`); | |
next(); | |
} | |
} | |
const step2: Middleware<any, any> = async (req, res, next) => { |
This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
var cc = ['#804080', | |
'#800000', | |
'#808080', | |
'#0000C0', | |
'#808000', | |
'#400080', | |
'#C0C000', | |
'#40C000', | |
'#4080C0', | |
'#C0C080', |
# data layers | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
include { | |
phase: TRAIN | |
} | |
data_param { | |
batch_size: 1 |
function down(uri, name) {console.log(uri,name); | |
var link = document.createElement("a"); | |
link.download = name; | |
link.href = uri; | |
link.click(); | |
} | |
function links() { | |
var $tr = $('.page-album__tracks .track_selectable'), l = $tr.length; | |
var queue = {}, i = 1; |
var simplerXHR = function( method, url) { | |
var _xhr = new XMLHttpRequest(); | |
_xhr.open( method, url ); | |
_xhr.setup = function(cb){ // hacky? maybe | |
cb(_xhr); | |
return _xhr; | |
}; | |
_xhr.done = function(cb){ // hacky? maybe | |
_xhr.onreadystatechange = function() { | |
if ( _xhr.readyState === 4 ) { |
var wrapworker = function (_function, data) { | |
var wrapr = this;var wrapworker = function (_function, data) { | |
var wrapr = this; | |
var mtd = "self.onmessage = function() {postMessage(" + _function.toString().replace('(','du(') + "(" + JSON.stringify(data) + "));};"; | |
blob = new Blob([mtd], { type: 'application/javascript' }); | |
var work = new Worker(URL.createObjectURL(blob)); | |
wrapr.ready = function (cb) { work.onmessage = cb; }; | |
wrapr.error = function (cb) { work.onerror = cb; }; | |
work.postMessage(true); | |
return wrapr; |