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
const THRESHOLD = 1000; | |
const FONTS = {google: {families: ['Open Sans Condensed:300,300i,700']}}; | |
const STYLESHEET = "body{font-family:'Open Sans Condensed',sans-serif}span.default{color:#00f}span.summary{color:gray;font-style:italic}span.hilite{color:red;font-weight:700}ul.tree li{list-style-type:none;position:relative}ul.tree li ul{display:none}ul.tree li.open>ul{display:block}ul.tree li a{color:#000;text-decoration:none}ul.tree li a:before{height:1em;padding:0 .1em;font-size:.8em;display:block;position:absolute;left:-1.3em;top:.2em}ul.tree li>a:not(:last-child):before{content:'+'}ul.tree li.open>a:not(:last-child):before{content:'-'}"; | |
(function init(doc) { | |
function summaryElements(txt) { | |
var ret = []; | |
var br = doc.createElement('br'); | |
ret.push(br); | |
var summarySpan = doc.createElement('span'); |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use diagnostics; | |
use Scalar::Util qw(looks_like_number); | |
print "{\"name\":\"com.newrelic.mqswig\",\"protocol_version\":\"1\",\"integration_version\":\"1.0.0\",\"metrics\":["; | |
while (<>) { |
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
{ | |
"glossary": { | |
"title": "example glossary", | |
"GlossDiv": { | |
"title": "S", | |
"GlossList": { | |
"GlossEntry": { | |
"ID": "SGML", | |
"SortAs": "SGML", | |
"GlossTerm": "Standard Generalized Markup Language", |
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
integration_name: com.newrelic.tcp-port-monitor | |
instances: | |
- name: localhost | |
command: metrics | |
arguments: | |
server: localhost | |
port: 21 | |
labels: | |
env: development |
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
Date.prototype.toISO8601 = function () { | |
var dateString = this.toString().split(" "); | |
return this.toJSON().substring(0,11)+dateString[4]+dateString[5].substr(3,3)+':'+dateString[5].slice(-2); | |
} | |
// example usage | |
(new Date).toISO8601(); |
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 queryStringToObj = function() { | |
var qs = location.search.substr(1).split(/&/); | |
var q = {}; | |
for (var i=0; i<qs.length; i+=1) { | |
var queryVar = qs[i].split('='); | |
var key = decodeURIComponent(queryVar[0]); | |
var val = (queryVar[1] === undefined) ? null : decodeURIComponent(queryVar[1]); | |
q[key] = val; | |
} | |
return q; |
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
_.mixin({ | |
hasProps: function (o, propPath) { | |
var prop = propPath.split('.'); | |
for (var p=0; p<prop.length; p++) { | |
if (!_.has(o, prop[p])) return false; | |
o = o[prop[p]]; | |
} | |
return true; | |
} | |
}); |
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(grunt) { | |
// Load grunt tasks automatically | |
require('load-grunt-tasks')(grunt); | |
// Time how long tasks take. Can help when optimizing build times | |
require('time-grunt')(grunt); | |
// Project configuration. | |
grunt.initConfig({ |