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
Friend.findOne({ | |
userId: req.signedCookies.userid | |
}, function (err, signedInUser) { | |
var friends = signedInUser.friends.map( | |
function (a) { return { user: a, type: 'friend' }; } | |
), | |
sentRequests = signedInUser.request_sent_to.map( | |
function (a) { return { user: a, type: 'sent' }; } | |
), |
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
* In 'funcs.js': | |
module.exports = { | |
generatePseudoRandomToken: generatePseudoRandomToken, | |
cookieWatcher: cookieWatcher | |
}; | |
function generatePseudoRandomToken() { | |
require('crypto').randomBytes(48, function(ex, buf) { | |
var token = buf.toString('hex'); | |
}); |
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
#include <v8.h> | |
#include <node.h> | |
#include <node_buffer.h> | |
#include <node_version.h> | |
#include <unistd.h> | |
#include <string> | |
#include <map> | |
#include <exception> | |
#include <exiv2/image.hpp> | |
#include <exiv2/exif.hpp> |
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
const Promise = require("bluebird"); | |
const fs = Promise.promisifyAll(require('fs')) | |
const getNumbers = () => new Promise((resolve, reject) => { | |
var fileNumbers = []; | |
for(var n = 0; n < 10; n++){ | |
fileNumbers.push(n); | |
} | |
resolve(fileNumbers); | |
}); |
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
const Promise = require("bluebird"); | |
const fs = Promise.promisifyAll(require('fs')) | |
function getNumbers() { | |
var fileNumbers = []; | |
for(var n = 0; n < 10; n++){ | |
fileNumbers.push(n); | |
} | |
return fileNumbers; | |
} |