Skip to content

Instantly share code, notes, and snippets.

View FernandoKahdal's full-sized avatar

Fernando Alves FernandoKahdal

View GitHub Profile
#!/bin/sh
#######################################################
# Another great script by: #
# _ , _ #
# / ) _, _ |) /|/_) ,_ _ _ #
# / / | / |/\ | \/ | / \_| | |_/|/| |/ #
# /__/\/|_/\__/| |/|(_/ |/\_/ \/ \/ | |_/|_/ #
# (| #
# #
/*---------------------
:: Food
-> model
---------------------*/
module.exports = {
attributes : {
name: 'STRING',
type: 'STRING',
expiration: 'DATE',
quantity: 'STRING',
module.exports = function (req,res,ok) {
var requiresUserId = false;
// not all records may need the user ID so let's see what entity we're dealing with in the call
switch(req.params.entity) {
case 'project':
case 'task':
requiresUserId = true;
break;
}
/**
* api/models/User.js
*
* The user model contains the instance method for validating the password.
*/
var bcrypt = require('bcrypt');
function hashPassword(values, next) {
bcrypt.hash(values.password, 10, function(err, hash) {
/*
* Extend your own models from BaseModel from now on
* e.g. `MyApp.Models.Zooby = BaseModel.extend({etc:etc})`;
*
* TODO: Don't forget to override `parse()` in your model.
* It should be something like `return data.modelName;`
* TODO: Don't forget to handle errors! Check data.errors for them.
*/
var BaseModel = Backbone.Model.extend({
methodUrl: function(method) {
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},