Skip to content

Instantly share code, notes, and snippets.

View npfitz's full-sized avatar

Nick Fitzpatrick npfitz

  • Metabase
  • Fredericton, NB
View GitHub Profile
,
'withCreator': function(req, res){
Discussion.find({
project: req.param("project")
})
.populate("comments")
.exec(function(err, discussions){
//Get all unique tags from moodboard images.
$scope.moodboard.tags = function(){
return _.uniq(
_.reduce($scope.moodboard.images, function(memo, image){
return memo.concat(image.tags);
}, [])
);
}
{
"name": "test",
"private": true,
"version": "0.0.0",
"description": "a Sails application",
"keywords": [],
"dependencies": {
"sails": "0.10.0-rc3",
"sails-mysql": "0.10.0-rc2",
"ejs": "~0.8.4",
/**
* Local environment settings
*
* While you're DEVELOPING your app, this config file should include
* any settings specifically for your development computer (db passwords, etc.)
*
* When you're ready to deploy your app in PRODUCTION, you can always use this file
* for configuration options specific to the server where the app will be deployed.
* But environment variables are usually the best way to handle production settings.
*
'projects': function(req, res){
User.findOne(req.session.user.id)
.populate("projects")
.populate("account")
.exec(function(err, user){
res.json(user, 200);
});
},
module.exports = {
migrate: 'alter',
schema: true,
attributes: {
//Name of the Project
name: {
var bcrypt = require('bcrypt-nodejs');
module.exports = {
migrate: 'alter',
schema: true,
attributes: {
{
"name": "test",
"private": true,
"version": "0.0.0",
"description": "a Sails application",
"keywords": [],
"dependencies": {
"sails": "~0.10.0-rc4",
"sails-mysql": "~0.10.0-rc3",
"ejs": "~0.8.4",
{
"name": "test",
"private": true,
"version": "0.0.0",
"description": "a Sails application",
"keywords": [],
"dependencies": {
"sails": "~0.10.0-rc4",
"sails-mysql": "~0.10.0-rc3",
"ejs": "~0.8.4",
'timeline': function(req, res){
Project.findOne(req.param("id"))
.populate("discussions")
.populate("moodboards")
.exec(function(err, project){
var retval = [];
//First, do all the stuff for discussions