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
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}"},"title":"TSVB Example: Events Per Second","uiStateJSON":"{}","version":1,"visState":"{\"type\":\"metrics\",\"aggs\":[],\"params\":{\"axis_formatter\":\"number\",\"axis_position\":\"left\",\"axis_scale\":\"normal\",\"default_index_pattern\":\"metricbeat-*\",\"default_timefield\":\"@timestamp\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"index_pattern\":\"kibana_sample*\",\"interval\":\">=10m\",\"isModelInvalid\":false,\"series\":[{\"axis_position\":\"right\",\"chart_type\":\"bar\",\"color\":\"rgba(104,204,202,1)\",\"fill\":\"1\",\"formatter\":\"number\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"line_width\":\"0\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"count\"},{\"id\":\"d2ea8870-79a2-11ea-8742-197c8d25f072\",\"type\":\"math\",\"variables\":[{\"id\":\"d745a530-79a2-11ea-8742-197c8d25f072\",\"name\":\"count\",\"field\":\"6 |
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 = function (kibana) { | |
return new kibana.Plugin({ | |
id: 'metric_sledgehammer', | |
uiExports: { | |
sledgehammers: [ | |
] | |
} | |
}); | |
}; |
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 wd = require('wd'); | |
var _ = require('lodash'); | |
var chai = require('chai'); | |
var chaiAsPromised = require('chai-as-promised'); | |
var asserters = wd.asserters; | |
var mocha = require('mocha'); | |
chai.use(chaiAsPromised); | |
chai.should(); | |
chaiAsPromised.transferPromiseness = wd.transferPromiseness; |
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
define(function (require) { | |
'use strict'; | |
var _ = require('lodash'); | |
var vents = {}; | |
return { | |
on: function (id, cb) { | |
if (!_.isArray(vents[id])) { | |
vents[id] = []; | |
} | |
vents[id].push(cb); |
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 request = require('request'); | |
var expect = require('chai').expect; | |
describe('GET /api/users', function () { | |
it('should return a 200 statusCode', function (done) { | |
request('http://localhost:5555/api/users', function (err, resp, body) { | |
expect(resp.statusCode).to.equal(200); | |
done(); | |
}); | |
}); | |
}); |
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
import natlink | |
import natlinkmain | |
import pprint | |
def myCallback(type,args): | |
print "type: %s" % type; | |
pprint.pprint(args); | |
apply(natlinkmain.changeCallback, [type,args]) | |
natlink.setChangeCallback(myCallback) |
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 insert = function (data, callback) { | |
console.log('fail', data); | |
callback(); | |
} | |
var update = function (data, callback) { | |
this.insert(data, callback); | |
}; | |
module.exports.insert = insert; |
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
snippet req "Require a module where it converts CamelCase to underscore (camel_case)" !b | |
var ${1:name} = require(${2:'${3:${1/(^[A-Z])|([A-Z])/(?2:_\l$2:\l$1)/g}}'}); | |
endsnippet |
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
siege -b -c 100 http://localhost:4444/cache-this |
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
-- Function: json_path(json, text) | |
-- DROP FUNCTION json_path(json, text); | |
CREATE OR REPLACE FUNCTION json_path(data json, path text) | |
RETURNS text AS | |
$BODY$ | |
/* JSONPath 0.8.0 - XPath for JSON | |
* | |
* Copyright (c) 2007 Stefan Goessner (goessner.net) |
NewerOlder