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
bundle.register('.jade', function (body) { | |
var options = {"client": true, "compileDebug": false}; | |
body = "module.exports = " + jade.compile(body, options).toString() +";"; | |
return body; | |
}); |
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 sessionCookie = cookie.parse(handshakeData.headers.cookie) | |
, parsedCookie = connect.utils.parseJSONCookies(connect.utils.parseSignedCookies(sessionCookie, config.sessionSecret))['connect.sess']; |
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
Chrome 22.0: Executed 5 of 5 SUCCESS (0.28 secs / 0.013 secs) | |
PhantomJS 1.6: Executed 5 of 5 SUCCESS (0.44 secs / 0.015 secs) | |
Safari 7534.48: Executed 5 of 5 SUCCESS (4.624 secs / 0.067 secs) | |
Safari 7534.48: Executed 5 of 5 SUCCESS (4.615 secs / 0.031 secs) |
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
$scope.getWidth = function() { | |
return $(window).width(); | |
}; | |
$scope.$watch($scope.getWidth, function(newValue, oldValue) { | |
$scope.window_width = newValue; | |
}); | |
window.onresize = function(){ | |
$scope.$apply(function() { | |
if($scope.window_width < 768) { | |
$rootScope.showMap = false; |
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
64 bytes from 74.125.225.34: icmp_seq=242 ttl=56 time=671.851 ms | |
64 bytes from 74.125.225.34: icmp_seq=243 ttl=56 time=300.758 ms | |
64 bytes from 74.125.225.34: icmp_seq=244 ttl=56 time=10195.477 ms | |
64 bytes from 74.125.225.34: icmp_seq=245 ttl=56 time=12608.617 ms | |
64 bytes from 74.125.225.34: icmp_seq=246 ttl=56 time=11721.149 ms | |
64 bytes from 74.125.225.34: icmp_seq=247 ttl=56 time=11333.200 ms | |
64 bytes from 74.125.225.34: icmp_seq=248 ttl=56 time=10350.588 ms | |
64 bytes from 74.125.225.34: icmp_seq=249 ttl=56 time=9370.136 ms | |
64 bytes from 74.125.225.34: icmp_seq=250 ttl=56 time=8805.165 ms | |
64 bytes from 74.125.225.34: icmp_seq=251 ttl=56 time=7809.359 ms |
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
User.resetToken = function(user, callback) { | |
console.log('in generateResetToken') | |
User.findOne({email: user.email}, function(err, user) { | |
if(err) { | |
console.log('error') | |
res.send(500) | |
} else { | |
var sha = crypto.createHash('sha1'); | |
console.log('sha ', sha) | |
sha.update((new Date()).toString() + user.email); |
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
User.newPassword = function(user, currentUser, done) { | |
pass.hash(password, function(err, salt, hash) { | |
currentUser.__password = { | |
salt: salt, | |
hash: hash | |
} | |
currentUser.updatedAt = new Date(); | |
User | |
.save(currentUser, done); |
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 DuplicateEmail(message) { | |
this.name = "DuplicateEmail"; | |
this.message = message || "Email already in use"; | |
} | |
DuplicateEmail.prototype = new Error(); | |
DuplicateEmail.prototype.constructor = DuplicateEmail; |
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
// Catch-all for HTML5 content serving. | |
router.use(function (req, res, next) { | |
if (req.accepts(['text/html','application/json']) == 'text/html') | |
res | |
.sendfile('public/index.html', {maxAge: 60000}); | |
else | |
next(); | |
}); |
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
// Gets user avatar url | |
router.get('/:userId/avatar', function(req, res) { | |
console.log("User", req.user.pictureUrl); | |
if (req.user.pictureUrl) { | |
console.log("redirecting avatar") | |
res.redirect(req.user.pictureUrl) | |
} else { | |
console.log("redirecting default") | |
res.redirect('/img/userProfileAvatar.png') | |
} |