brew install redis
Set up launchctl to auto start redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
/usr/local/opt/redis/
is a symlink to /usr/local/Cellar/redis/x.y.z
(e.g., 2.8.7
)
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test'); | |
var db = mongoose.connection; | |
db.on('error', function() { | |
return console.error.bind(console, 'connection error: '); | |
}); | |
function GetRFC822Date(oDate){ | |
// allow for empty request | |
if(typeof(oDate) == "undefined" || !oDate) oDate = new Date(); | |
//Pads numbers with a preceding 0 if the number is less than 10. | |
var LZ = function(val){ return (parseInt(val) < 10) ? "0" + val : val; } | |
/* accepts the client's time zone offset from GMT in minutes as a parameter. returns the timezone offset in the format [+|-}DDDD */ | |
var getTZOString = function(timezoneOffset){ |
var fs = require("fs"); | |
var path = require("path"); | |
var rmdir = function(dir) { | |
var list = fs.readdirSync(dir); | |
for(var i = 0; i < list.length; i++) { | |
var filename = path.join(dir, list[i]); | |
var stat = fs.statSync(filename); | |
if(filename == "." || filename == "..") { |