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
| node_modules | |
| dist/ |
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
| /** | |
| * Simple promisifier for a function that expects a node-like callback | |
| * @param {Function} fn Function to promisify, should expect a node-like callback as the last parameter | |
| * @return {Function} the promisified wrapped version of the function | |
| */ | |
| module.exports = function promisify (fn) { | |
| return function () { | |
| var paramsArr = Array.prototype.slice.call(arguments); | |
| return new Promise(function (resolve, reject) { |
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 express = require('express'); | |
| var Promise = require('bluebird'); | |
| var app = express(); | |
| var router = express.Router(); | |
| router.get('/error', function(req, res, next) { | |
| return new Promise(function() { | |
| throw new Error('boom'); | |
| }).catch(next); | |
| }); |
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 workorder = { | |
| "_id": "59aafac97037bfbab2a8f9a1", | |
| "id": "SJ8b3Mr8g", | |
| "assignee": "rkX1fdSH", | |
| "title": "Accident No. 3019", | |
| "status": "New", | |
| "stepHistory": [ | |
| { | |
| id: 'someid', | |
| user: 'trever' |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <zone> | |
| <source address="172.17.0.0/16"/> | |
| <port port="8443" protocol="tcp"/> | |
| <port port="53" protocol="udp"/> | |
| <port port="8053" protocol="udp"/> | |
| <port port="443" protocol="tcp"/> | |
| </zone> |
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
| class ServiceModule {} | |
| class SyncService extends ServiceModule {} | |
| class KeycloakService extends ServiceModule {} | |
| type ServiceModuleConstructor<T extends ServiceModule> = new() => T; | |
| class ServiceModuleRegistry { | |
| private serviceTypeMap: { | |
| [key: string]: ServiceModuleConstructor<ServiceModule> |
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
| export interface IKeycloakConfig {} | |
| export interface IMetricsConfig {} | |
| export class Config { | |
| private serviceConfig: any[] = []; | |
| /** | |
| * @param config - any type of configuration that will be send from server. | |
| * It's not possible easy/worth to wrap that to types. Even native implementations do not do that. |
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
| /* | |
| Tested with data generated by | |
| autocannon -a 150000 -m POST -I -b '{"clientId":"[<id>]","data":{"app":{"appId":"com.example.someApp","sdkVersion":"2.4.6","appVersion":"256"},"device":{"platform":"android","platformVersion":"27"}}}' http://localhost:3000/metrics | |
| Thus creating 150k records. | |
| This uses generated clientIds and the rest of the data is constant, thus it doesn't match very well the expected cardinality, | |
| I'd like to redo these tests with better random data. | |
| For example we wouldn't have unique clientIds per record, and have some variance in device platform, and some less in app info, and also a much bigger spread in event_times. |
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
| oc login -u system:admin | |
| oc adm policy add-cluster-role-to-user access-asb-role developer | |
| oc adm policy add-cluster-role-to-user cluster-admin developer |
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
| const apply = (x, fn) => fn(x); | |
| const c = (...fns) => { | |
| [first, ...rest] = fns.reverse(); | |
| return x => rest.reduce(apply, first(x)); | |
| } | |
| const add = x => y => x + y; | |
| c(add(1), add(4))(3); |
OlderNewer