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
/* | |
(2,4) | |
(1,3) -------- (7,8) | |
---------- ------- | |
1 2 3 4 5 6 7 8 | |
total covered length = 4-1 + 8-7 = 4 | |
*/ | |
var assert = require('assert'); |
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
// | |
// serviceWorkerService.js | |
// | |
'use strict'; | |
angular.module('myApp.serviceWorker', []) | |
.service('serviceWorkerService', ['$q', '$http', '$location', '$timeout', | |
function($q, $http, $location, $timeout) { | |
var noTokenError = new Error('No Instance ID token available'); | |
var noPermissionError = new Error('Unable to get permission to notify'); |
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 FirebaseTokenGenerator = require("firebase-token-generator"); | |
var Firebase = require("firebase"); | |
var async = require("async"); | |
var steps = []; | |
var tokenGenerator = new FirebaseTokenGenerator("sdfsdfsdfsdfsdf"); | |
var token = tokenGenerator.createToken({ uid: "uniqueId1", some: "arbitrary", data: "here" }); | |
var ref = new Firebase("https://sdfsdfsdf.firebaseio.com/messages/xyz"); | |
var Parse = require('node-parse-api').Parse; |
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 mongoose = require ("mongoose"); // The reason for this demo. | |
mongoose.set('debug', true); | |
// Here we find an appropriate database to connect to, defaulting to | |
// localhost if we don't find one. | |
var uristring = | |
process.env.MONGOLAB_URI || | |
process.env.MONGOHQ_URL || | |
'mongodb://localhost/iot'; |
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 winterbrk2015 = { | |
what: 'Web / Mobile Application Development Contest', | |
when: 'Nov 30, 2014 to Jan 15, 2015', | |
where: 'In the clouds', | |
why: 'You know why we do it, if not, check out http://startupbrk.com/' | |
prizes: '8K, 4K, 2K (not $$) and potentially more', | |
signupLink: 'https://docs.google.com/forms/d/1b1H2tthtQfShuoAVu_XIhapSiNWFok4uXrVPPHjigDg/viewform' | |
}; |