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 questions = [ | |
| { id:'fname', text:'First Name', answerType:'str' }, | |
| { id:'lname', text:'Last Name', answerType:'str' }, | |
| { id:'age', text:'Age', answerType:'int' }, | |
| { id:'weight', text:'Weight', answerType:'float' } | |
| ] | |
| function ask(question, callback) { | |
| var stdin = process.stdin, stdout = process.stdout; |
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
| // Generates a URL-friendly "slug" from a provided string. | |
| // For example: "This Is Great!!!" transforms into "this-is-great" | |
| function generateSlug (value) { | |
| // 1) convert to lowercase | |
| // 2) remove dashes and pluses | |
| // 3) replace spaces with dashes | |
| // 4) remove everything but alphanumeric characters and dashes | |
| return value.toLowerCase().replace(/-+/g, '').replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, ''); | |
| }; |
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
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
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
| /* | |
| * Simple Sendmail | |
| * Changes : | |
| * - Added base64 encoding to username and password | |
| * - Handling a simple attachment ( single base64 encoded attachment ) | |
| */ | |
| var net = require('net') | |
| , config = { |
NewerOlder