This file contains 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
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
This file contains 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 app = express(); | |
app.io = require('socket.io')(); | |
var routes = require('./routes/index')(app.io); | |
app.use('/', routes); |
This file contains 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
'use strict'; | |
// Declare app level module which depends on views, and components | |
angular.module('myApp', [ | |
'ngRoute', | |
'myApp.view1', | |
'myApp.view2', | |
'myApp.version', | |
'btford.socket-io' | |
]). |
This file contains 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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
concat: { | |
css: { | |
src: [ | |
'css/*' //What folder to look at for your css files | |
], | |
dest: 'combined.css' //Where or what to name your concat css | |
}, |
This file contains 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 fs = require("fs"); | |
function main() { | |
fs.readdir("./node_modules", function (err, dirs) { | |
if (err) { | |
console.log(err); | |
return; | |
} | |
dirs.forEach(function(dir){ | |
if (dir.indexOf(".") !== 0) { |
This file contains 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
'use strict' | |
const express = require('express'); | |
const app = express(); | |
const Promise = require('bluebird'); | |
const {coroutine: co} = require('bluebird'); //Alias coroutine | |
app.listen(3000, function () { | |
console.log('Example app listening on port 3000!') | |
}) | |
app.get('/', (req, res)=>{ |
This file contains 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
//This is the DB file im writing the fucntions in | |
const redis = Promise.promisifyAll(require('redis')); | |
const client = redis.createClient(); | |
const Promise = require('bluebird'); | |
const {coroutine: co} = require('bluebird'); //Alias coroutine | |
const wrapper = require('./lib.js'); | |
module.exports.SomeFunction(key, value) { | |
return wrapper(function(){ | |
let set = yield client.set(key, value); |