Skip to content

Instantly share code, notes, and snippets.

'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
NoteSchema = require('./note'),
LoanSchema = require('./loan'),
Loan = mongoose.model('Loan'),
util = require('util'),
@wkentdag
wkentdag / gist:fa95151af79a7daaea7c
Created May 6, 2015 23:19
populating db in production mode
# Make a user
curl -X POST 'http://localhost:3000/users' -d 'first_name=Will&last_name=Test&phone=123456789'
# Make a status
curl -X POST 'http://localhost:3000/status' -d 'owner_id=1&longitude=100&latitude=100&duration=30'
# the above fields are all required. to add viewing permissions to users OTHER than the owner, add:
'&selectedFriends[]=2&selectedFriends[]=5' # etc
# and to add a 160char-max message, add:
'&message="hey there im awesome"'
@wkentdag
wkentdag / gist:4efeb5381601306c82f8
Last active August 29, 2015 14:20
sup api from the command line
Creating a new user:
curl -X POST 'http://localhost:3000/users' # development monde
curl -X POST 'http://localhost:3000/users' -d 'first_name=will&last_name=kd&phone=123456' # production mode
Creating a new status:
curl -X POST 'http://localhost:3000/status' -d 'fake_owner_id=1' # development mode
curl -X POST 'http://localhost:3000/status' -d 'owner_id=6&longitude=666&latitude=111' # production mode
Granting a user permission to view a status:
curl -X POST 'http://localhost:3000/status/:id/viewers' -d 'user_id=6' # :id = valid status id

Study these screenshots:

https://innig.net/tmp/nr-screenshots/

Fork this gist (one fork per team).

Sketch out an object model for this application. Don't worry about view, network, database, etc.; your concern is only to represent the essential information of this application as classes and attributes. You can use the following attribute types:

  • numbers, strings, dates
  • other model classes
@wkentdag
wkentdag / wmcn-tumblr_12515
Created January 26, 2015 01:16
wmcn.tumblr.com @ 1/25/15
<!DOCTYPE html>
<html>
<head>
<!-- "wmcn" theme by will kent-daggett:
willkentdaggett@gmail.com
github.com/wkentdag
github.com/wkentdag/wmcn-tumblr/