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
// A simple example showing how to use async to parallelize several invocations to asynchronous functions and wait for the result. | |
var async = require('async'); | |
/** | |
* A very simple asynchronous function which takes in a number and invokes the callback with that number incremented by 1. | |
* @param number | |
* @param cb(err, result) | |
*/ | |
function addOne(number, cb) { | |
process.nextTick(function() { |
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> | |
<link rel="stylesheet/less" type="text/css" href="problem.less"> | |
<script> | |
less = { | |
env: 'production' | |
}; | |
var useGlobalVars = true; | |
if (useGlobalVars) { |
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 foo = function () { | |
var promise = new Promise(function (resolve, reject, notify) { | |
setTimeout(function () { | |
resolve(); | |
}, 100); | |
}); | |
return promise; | |
}; |
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": "simpleapp", | |
"description": "simple application", | |
"version": "0.0.1", | |
"author": { | |
"name": "Tim Douglas" | |
}, | |
"dependencies": { | |
"express": "3.4.8", | |
"moment": "2.5.1" |
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> | |
<script src="jquery-1.11.1.min.js"></script> | |
<script src="jquery.gdb.js"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<div data-bindto="data.lastUpdated"></div> | |
</body> |
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
Tue Mar 03 2015 11:01:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:02:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:04:17 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:04:17 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:05:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:06:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:07:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:08:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:09:00 GMT+1100 (AEDT) | |
Tue Mar 03 2015 11:10:00 GMT+1100 (AEDT) |
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> | |
<script src="iwc-all.js"></script> | |
<script> | |
// The amount of time the async function is likely to take in (in milliseconds). | |
var ASYNC_DURATION_MIN = 10; | |
var ASYNC_DURATION_MAX = 5000; | |
// The amount of time before we attempt to send again (in milliseconds). |
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
const http = require('http'); | |
function onRequest(clientReq, clientRes) { | |
console.log(`serve: ${clientReq.url}`); | |
const options = { | |
hostname: 'foo.ngrok.io', | |
port: 80, | |
path: clientReq.url, | |
method: 'GET', |