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
vertx.setPeriodic(200, function (id) { | |
if (!isRequest2Finished || !isRequest3Finished) { | |
return; | |
} | |
vertx.cancelTimer(id); | |
if (memberid && planID) { | |
req.response.headers().set('Location', '/plans/'+planID); | |
req.response.statusCode(301); | |
req.response.end(); | |
} |
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 vertx = require('vertx'), | |
console = require('vertx/console'), | |
client = vertx.createHttpClient().host('google.com'), | |
rm = new vertx.RouteMatcher(); | |
rm.get('/', function(req) { | |
console.log("rm1"); | |
req.bodyHandler(function (body) { | |
console.log("rm2"); | |
req.response.end("Hello, World"); | |
}); |
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 vertx = require('vertx'), | |
console = require('vertx/console'), | |
client = vertx.createHttpClient().host('google.com'), | |
rm = new vertx.RouteMatcher(); | |
rm.get('/', function (req) { | |
var request, | |
request2, | |
isReq2Finished = false; | |
request = client.get("/", function (resp) { | |
////do something with the response |
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 count = 0, | |
vertx = require('vertx'), | |
console = require('vertx/console'), | |
client = vertx.createHttpClient().host("livingapi.getnextt.com"), | |
rm = new vertx.RouteMatcher(); | |
rm.get('/', function (req) { | |
console.log("req"); | |
var request, | |
request2, | |
isReq1Finished = false, |
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 vertx = require('vertx'), | |
console = require('vertx/console'), | |
client = vertx.createHttpClient().host('www.googleapis.com').port(443), | |
rm = new vertx.RouteMatcher(); | |
rm.get('/', function(req) { | |
var request = client.get("/oauth2/v1/tokeninfo", function (resp) { | |
console.log(resp.statusCode() + " - " + resp.statusMessage()); | |
req.response.end("Hello, World"); | |
}); | |
request.chunked(true); |
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
//// also assumes the this object has a "calendar" property that is the array of results from GET /plans/me/calendar | |
Handlebars.registerHelper('generateCalendar', function (ISOString) { | |
var date = new Date(ISOString), | |
max = date.getLastDayOfMonth(), | |
selected = new Date(this.selected), /// passed in as ?selected=[ISOString] on request, stored | |
output = "<tr>", | |
calIndex = 0, | |
j = 0, | |
i = 0; | |
date.setDate(date.getDate() - date.getDay()); |
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
#upcoming { | |
#calendar { | |
&>div { | |
text-align: center; | |
font-size: 24px; | |
button { | |
padding: 5px 12px; | |
} | |
} | |
} |
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 (windowPathname.indexOf("/upcoming") > -1) { | |
var $calRadios = document.getElementsByTagName('input'), | |
$lastActive = document.getElementsByClassName('active')[0], | |
$calList = document.getElementById('planIdeaList'), | |
$couldDoIndicator = document.getElementById('indicator'), | |
$couldDo = document.getElementById('couldDo') | |
$couldDoWrap = document.getElementById('couldDoWrap'); | |
addActionButtonListeners(document.getElementsByClassName('actionButton')); | |
if ($couldDoWrap) { | |
$couldDoWrap.addEventListener(touchEvent, function (e) { |
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 vertx = require('vertx'), | |
console = require('vertx/console'), | |
client = vertx.createHttpClient().host('google.com'), | |
rm = new vertx.RouteMatcher(); | |
rm.get('/', function(req) { | |
console.log("rm1"); | |
req.bodyHandler(function (body) { | |
console.log("rm2"); | |
req.response.end("Hello, World"); | |
}); |
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 sendAJAX(url, method, callback, data, headers) { | |
var xhReq = new XMLHttpRequest(); | |
if (method !== "POST" && method !== "GET" && method !== "PUT" && method !== "DELETE") { | |
return false; | |
} | |
xhReq.open(method, url); | |
if (typeof(headers) != "undefined") { | |
for (var i = 0; i < headers.headers.length; i++) { | |
xhReq.setRequestHeader(headers.headers[i].type, headers.headers[i].value); | |
} |
OlderNewer