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
express = require('express') | |
app = express.createServer() | |
# Setup Template Engine | |
app.register '.coffee', require('coffeekup') | |
app.set 'view engine', 'coffee' | |
# Setup Static Files | |
app.use express.static(__dirname + '/public') |
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
Don-Brownings-MacBook-Pro:node donwb$ history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -nr | head -n 50 | |
166 node | |
81 git | |
69 ls | |
68 jitsu | |
34 cd | |
19 pwd | |
14 npm | |
10 vi | |
6 ssh |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var app = module.exports = express.createServer(); | |
// Configuration |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var app = module.exports = express.createServer(); | |
// Configuration |
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
exports.getGames = function getGames(start, end, callback) { | |
var s = start.format('YYYY-MM-DD'); | |
var e = end.format('YYYY-MM-DD'); | |
mongodb.connect(mongoUrl, function(err, con){ | |
if(err) { | |
console.log('Error: ' + err); | |
} | |
con.collection('baseball', function(err, col){ | |
col.find({"AirDate":{$gte: s, $lt:e}}).toArray(function(err, results){ |
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
mongoose.connect('mongodb://' + settings.user + ':' + settings.pass + '@' + settings.host + ':' + settings.port + '/' + settings.name, {server: {socketOptions: {keepAlive: 1}}}); |
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
key=/title/maxbefore/jq0jqr52.com?g=257863DF-CBCF-4486-8E21-3A48F417B4B9&s=5FA810DC-7AF7-11E2-97F6-12313B082201&z=10122197 | |
parsing this date: jq0jqr52.com | |
isValid: false | |
invalid date was passed in...returning the default value passed in... | |
objectId: 51d06d4b4f90853417000006 | |
key=/title/maxbefore/jq0jqr52.com?g=257863DF-CBCF-4486-8E21-3A48F417B4B9&s=5FA810DC-7AF7-11E2-97F6-12313B082201&z=10122212 | |
parsing this date: jq0jqr52.com | |
isValid: false | |
invalid date was passed in...returning the default value passed in... | |
objectId: 51d06d594f90853417000007 |
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
#!upstart | |
description "node.js server" | |
author "Someone that likes Node" | |
# used to be: start on startup | |
# until we found some mounts weren't ready yet while booting: | |
start on (local-filesystems and net-device-up) | |
stop on shutdown | |
# Automatically Respawn: |