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 executeCommand = function(obj){ | |
exec(obj.cmd, function(err, stdout, stderr){ | |
var data = { | |
error: err, | |
stdout:stdout, | |
stderr: stderr | |
} | |
if (!writeToLog(obj.projectName, obj.service, data)){ | |
errorResponse(response, 'Unable to write to log directory, check permissions') |
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
routePatterns: function(){ | |
var services = alfAgent.properties.services; | |
var s = []; | |
for(var i=0; i < services.length; i++){ | |
s.push(services[i].name.toLowerCase()); | |
} | |
return routePatterns = { | |
post: "^\/(" + s.join("|") + ")$", | |
delete: "^\/(" + s.join("|") + ")\/(.+)$" |
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
app.post(new RegExp(routePatterns.post), function(request, response) { | |
var service = request.params[0]; | |
console.log('ServicesController: Received request to create new ' + service + ' instance /w request=' + request + '...'); | |
// Validate the request | |
if (!validate(request)){ | |
return errorResponse(response, 'Missing or invalid query parameters'); | |
} |
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 http = require('http'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var base = __dirname; | |
http.createServer (function(req, res){ | |
pathname = base + req.url; | |
console.log(pathname); | |
path.exists(pathname, function(exists){ |
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
function heartbeatInit(properties) { | |
console.log('HeartbeatService.init.heartbeatInit: Sending initial heartbeat to ALF server @ ' + properties.alfServer + ':' + properties.alfServerPort + properties.PATH_TO_ALF_HEARTBEAT_SERVICE + ' for host "' + hostName + '"...'); | |
// Setup the data that's going to be sent to the ALF server on agent init | |
var initData = { | |
agentName: properties.agentName, | |
hostName: hostName, | |
port: properties.port, | |
services: properties.services |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div> | |
<i id="spinner" class="fa fa-2x fa-spin fa-smile-o"></i> |
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
'use strict'; | |
/* | |
Usage: <wysiwyg textarea-id="question" textarea-class="form-control" textarea-height="80px" textarea-name="textareaQuestion" textarea-required ng-model="question.question" enable-bootstrap-title="true"></wysiwyg> | |
options | |
textarea-id The id to assign to the editable div | |
textarea-class The class(es) to assign to the the editable div | |
textarea-height If not specified in a text-area class then the hight of the editable div (default: 80px) | |
textarea-name The name attribute of the editable div | |
textarea-required HTML/AngularJS required validation |
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 sen = "The quick brown fox"; | |
function codeMessage(message){ | |
var bin = ''; | |
var message = sen.split('') | |
for(var i=0; i < message.length; i++){ | |
var letter = message[i]; | |
var code = letter.charCodeAt().toString(2); | |
bin += new Array( 8-code.length+1 ).join( '0' ) + code; |
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 connect = require('connect'); | |
connect.createServer( | |
connect.static(__dirname) | |
).listen(8088); | |
console.log('Server started on port 8088'); |
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
<html> | |
<head> | |
<title>Teset</title> | |
</head> | |
<body> | |
<button onclick="notifyMe()">Notify me!</button> | |
<script type="text/javascript"> |