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
// 1. you may need to download angular-routes separately - I got it along with the angular webjar | |
// 2. add path and shim config | |
// require config | |
requirejs.config({ | |
shim: { | |
"app": ["angular"], | |
"angular-route": ["angular"] // !!! |
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 some functions and pretend they need to | |
// be asynchronous just for demonstration purposes | |
function plus(n1, n2, cb) { | |
return cb(n1+n2); | |
} | |
function minus(n1, n2, cb) { | |
return cb(n1-n2); | |
} |
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); |
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
// 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
{ | |
"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
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
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
<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
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 |
OlderNewer