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 db, mongoConnectionString, mongojs, query; | |
| mongojs = require("mongojs"); | |
| var ObjectId = mongojs.ObjectId | |
| var async = require("async") | |
| var _ = require("underscore") | |
| mongoConnectionString = "mongodb://127.0.0.1/sharelatex-production"; |
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() { | |
| var zlib = require('zlib'); | |
| var ObjectId, UserGetter, db, mongojs; | |
| mongojs = require("../../infrastructure/mongojs"); | |
| console.log("hello") | |
| db = mongojs.db; | |
| ObjectId = mongojs.ObjectId; |
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
| euCountries = ["AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "EL", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE", "GB"] | |
| _ = require("underscore") | |
| fs = require("fs") | |
| file = fs.readFileSync("./transactions.csv", "utf-8") | |
| lines = file.split("\n") | |
| groupedTransactions = _.groupBy lines, (line)-> | |
| vals = line.split(",") |
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
| sinon = require('sinon'); | |
| chai = require('chai'); | |
| should = chai.should(); | |
| SandboxedModule = require('sandboxed-module'); | |
| modulePath = "./UserHandler"; | |
| describe('User Handler', function() { | |
| var user_id = "12345" |
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
| request = require("request") | |
| module.exports = { | |
| getUserDetails: function(user_id, callback){ | |
| var url = "http://www.api.com/user/" + user_id | |
| request.get(url, function(err, response, body){ | |
| callback(err, 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
| cachedEvents: {} | |
| onlySingleClick: (e, waitBetweenClicks = 500)-> | |
| foundTime = cachedEvents[e.target] | |
| now = new Date().getTime() | |
| difference = now - foundTime | |
| cachedEvents[e.target] = now | |
| return difference > waitBetweenClicks |
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
| [henry@dyn207249:~/Desktop/a]$ npm install now -g | |
| > [email protected] install /usr/local/lib/node_modules/now/node_modules/node-proxy | |
| > make | |
| sh: make: command not found | |
| npm ERR! error installing [email protected] Error: [email protected] install: `make` | |
| npm ERR! error installing [email protected] `sh "-c" "make"` failed with 127 | |
| npm ERR! error installing [email protected] at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20) | |
| npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17) |
NewerOlder