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 gcprofiler = require('gc-profiler'); | |
var fs = require('fs'); | |
var _datadir = null; | |
module.exports.init = function (datadir) { | |
var stamp = Date.now(); | |
var time = process.hrtime(); |
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
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr | |
http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx | |
http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate | |
# Be sure to remember to chain them! | |
cat gd_bundle-g2-g1.crt >> yourdomain.crt | |
# Move 'em | |
sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt |
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
<body> | |
// Your content | |
// [..] | |
// Include our ADK | |
<script src="/<path>/<to>/dtagentApi.js"></script> | |
<script> | |
// Use jQuery | |
jQuery(function ($) { | |
// Make sure that Dynatrace / UEM is present |
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 myAdder = require('./adder'); | |
console.log(myAdder.version); // will print 0.0.1 | |
console.log(myAdder.add(4, 23)); // will print 27 |
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.version = '0.0.1'; | |
module.exports.add = function (a, b) { | |
return a + b; | |
}; |
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
{ | |
"name": "SomeTestproject", | |
"version": "0.0.1", | |
"description": "Some description", | |
"main": "main.js", | |
"dependencies": { | |
"express": "^4.12.2", | |
"mongodb": "^1.4.33", | |
"mysql": "^2.5.5", | |
"restify": "^2.8.5" |
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
// Require the http core module | |
var http = require('http'); | |
// Create a server and provide a function (callback) that | |
// gets called for every request | |
http.createServer(function (req, res) { | |
// Speccify a content type | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
// Write into the response object sent to the client |
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
/** | |
* Simple userland CPU profiler using v8-profiler | |
* Usage: require('[path_to]/CpuProfiler').init('datadir') | |
* | |
* @module CpuProfiler | |
* @type {exports} | |
*/ | |
var fs = require('fs'); | |
var profiler = require('v8-profiler'); |
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
/** | |
* Simple userland heapdump generator using v8-profiler | |
* Usage: require('[path_to]/HeapDump').init('datadir') | |
* | |
* @module HeapDump | |
* @type {exports} | |
*/ | |
var fs = require('fs'); | |
var profiler = require('v8-profiler'); |
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 isValidUser(username, cb) { | |
if(username !== 'Frank') cb("Access denied!"); | |
cb("Access granted!") | |
} | |
isValidUser("Tom", function(msg) { | |
// This will output "Access denied!" AND "Access granted!" | |
console.log(msg); |