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
app.get('/vendors.json', function(req, res) { | |
var session = req.session; | |
var query = mods.url.parse(req.url,true).query; | |
var p_vendors = mods.mongoose.model('p_vendors'); | |
var vendors = mods.mongoose.model('vendors'); | |
var results = []; | |
p_vendors.find({ account_id: session.account_id }, function(err, docs) { |
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
// Roles | |
this.roles = { | |
description: { type: String }, | |
text: { type: String }, | |
id: { type: String }, | |
parent: { type: String }, | |
leaf: { type: Boolean } | |
}; | |
this.p_roles = { |
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
app.get('/users.json', function(req, res) { | |
var accounts = mods.mongoose.model('accounts'); | |
var query = modules.url.parse(req.url,true).query; | |
accounts.find({name: new RegExp(query.query, 'i') }, function(err, docs) { | |
var results = { | |
success: true, | |
results: docs.length, | |
items: docs |
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 p_roles = mods.mongoose.model('p_roles'); | |
var accounts = mods.mongoose.model('accounts'); | |
var ninAccounts = []; | |
var inAccounts = []; | |
p_roles.find({ role_id: query.role_id }, function(err, docs) { | |
var async = mods.async; | |
var pushNinAccounts = function(item, callback) { |
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 populateMetrics = function() { | |
metricsFiles = []; | |
var addMetric = function(file, callback) { | |
fs.stat(path + '/' + file, function(err, stats) { | |
if(stats.isDirectory()) { | |
fs.stat(path + '/' + file + '/Metrics.txt', function(err, stats) { | |
if(err) { | |
callback(); | |
} else { |
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
beadChip.prototype.init = function(file) { | |
// Localize beadChip members | |
var build = this.buildBeadChip; | |
var rows = this.rows; | |
var sections = this.sections; | |
var pass = this.pass; | |
var fail = this.fail; | |
var metricStream = fs.createReadStream(file, { |
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
sectionObject = { | |
date: sectionArray[0], | |
beadChip: sectionArray[1], | |
section: sectionArray[2], | |
focusGrn: Number(sectionArray[3]), | |
regGrn: Number(sectionArray[4]), | |
p05Grn: Number(sectionArray[5]), | |
p95Grn: Number(sectionArray[6]), | |
focusRed: Number(sectionArray[7]), | |
regRed: Number(sectionArray[8]), |
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 singleScan = function(file, callback) { | |
var path = file; | |
var fileArray = file.split('/'); | |
var name = fileArray[fileArray.length - 1]; | |
var bead = fileArray[fileArray.length - 2]; | |
fs.stat('archive/' + bead + '_' + name, function(err, stats) { | |
if(err) { |
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
mongoose.connect('mongodb://localhost/serveyus'); | |
var schema = mongoose.Schema, | |
ObjectID = schema.ObjectId; | |
mongoose.model('owner', new schema({ | |
username: { type: String }, | |
description: { type: String }, | |
email: { type: String }, | |
password: { type: String } | |
}); |
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
// npm install async | |
// installs to ./node_modules | |
var db; // Pretend this is a valid async DB connection | |
var async = require('async'); | |
var bigArray = []; // Pretend this is full of data | |
var returnResults = []; // Pretend this is empty |
OlderNewer