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
PORT=800 node | |
process.env.PORT | |
http://nodejs.org/docs/v0.4.7/api/ | |
nodemon | |
superviser | |
node debug script.js |
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
// SSL with Node and Express method 1: | |
var express = require('express') | |
, fs = require("fs") | |
, routes = require('./routes'); | |
var privateKey = fs.readFileSync('cert/key.pem').toString(); | |
var certificate = fs.readFileSync('cert/certificate.pem').toString(); | |
// to enable https |
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
# Install HAProxy | |
cd ~ | |
wget http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev6.tar.gz | |
tar xzf haproxy-1.5-dev6.tar.gz | |
cd haproxy* | |
make install | |
# HAProxy config | |
mkdir /etc/haproxy |
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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>OpenTok API Sample — Basic Tutorial</title> | |
<link href="samples.css" type="text/css" rel="stylesheet" > | |
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<script type="text/javascript" charset="utf-8"> |
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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>OpenTok API Sample — Basic Tutorial</title> | |
<link href="samples.css" type="text/css" rel="stylesheet" > | |
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<script type="text/javascript" charset="utf-8"> |
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
// Format JSON function | |
// http://ketanjetty.com/coldfusion/javascript/format-json/ | |
var formatJson = function (val) { | |
var retval = ''; | |
var str = val; | |
var pos = 0; | |
var strLen = str.length; | |
var indentStr = ' '; | |
var newLine = '<br />'; |
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
if (jslogger) { | |
if(!window.console) window.console = {}; | |
var methods = ["log", "debug", "warn", "info"]; | |
for(var i=0;i<methods.length;i++){ | |
console[methods[i]] = function(){jslogger.log.apply(jslogger, arguments);}; | |
} | |
} |
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
# Add it to /etc/environment | |
LC_ALL="en_US.UTF-8" | |
# or execute it to the console | |
export LC_ALL="en_US.UTF-8" |
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
'use strict'; | |
console.log('Loading function'); | |
let doc = require('dynamodb-doc'); | |
let dynamo = new doc.DynamoDB(); | |
/** | |
* Provide an event that contains the following keys: | |
* | |
* - operation: one of the operations in the switch statement below |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.min.js"></script> | |
</head> | |
<body> |
OlderNewer