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
//Lets require/import the HTTP module | |
var http = require('http'); | |
//Lets define a port we want to listen to | |
const PORT=8080; | |
//We need a function which handles requests and send response | |
function handleRequest(request, response){ | |
response.end('It Works!! Path Hit: ' + request.url); | |
} |
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 net = require('net'); | |
var tls = require('tls'); | |
var path = require('path'); | |
var protobuf = require('protocol-buffers'); | |
var initialize = function(api, options, next) { | |
var type = 'protobuf'; | |
var attributes = { | |
pendingShutdownWaitLimit: 5000, | |
schema: require('fs').readFileSync(path.join(__dirname, 'schema.proto')).toString() |
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'; | |
var uuid = require('node-uuid'); | |
exports.action = { | |
name: 'securityApiKey', // Internal security action. Do not change the name. | |
description: 'I hand out api keys.', | |
version: 1.0, | |
inputs: { | |
uniqueId: { | |
required: true, | |
validator: function(param, connection, actionTemplate){ |
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
unsigned short crc_16_rec(unsigned char * pucData, unsigned short ucLen) { | |
//-------------------------------------------------------------------- | |
unsigned int i; | |
unsigned char ucBit, ucCarry; | |
//-------------------------------------------------------------------- | |
unsigned short usPoly = 0x8408; //reversed 0x1021 | |
unsigned short usCRC = 0; | |
//-------------------------------------------------------------------- | |
for (i = 0; i < ucLen; i++) { | |
usCRC ^= pucData[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
*Example Usage: | |
CLEAR | |
Builder = CREATEOBJECT('HttpMessageBuilder') | |
*Builder.UserAgent = 'BK5' | |
Builder.AddHeader('TestHeader', 'test123 456') | |
Builder.AddHeader('TestHeader', 'test123 456') | |
Builder.AddParameter('TestParameter', 'Thisisat estparameter') | |
Builder.AddParameter('TestParameter', 'Thisisatestparam eter') | |
* You also get a free URLEncode function :) | |
Builder.URLEncode('str in g <3') |
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
oRE = CreateObject("VBScript.RegExp") | |
oRE.Pattern = "regular expression here" | |
lcString = "string to search" | |
llResult = oRE.test(lcString) | |
lcMatches = oRE.Execute(lcString) | |
IF ALEN(lcMatches) > 0 | |
llResult = lcMatches(0).Submatches(0) && First match and first submatch/group | |
ENDIF |
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 DECSTR64 | |
PARAMETERS S | |
LOCAL i,j,j,k,q,ch,s2,buf,tmpc | |
tmpc = 0 | |
j = 0 | |
buf = 0 | |
s2 = '' | |
k = LEN(s) | |
FOR i = 1 TO k | |
ch = ASC(SUBSTR(s,i,1)) |
OlderNewer