Skip to content

Instantly share code, notes, and snippets.

View 4nth0's full-sized avatar
๐Ÿ—

Anthony Capirchio 4nth0

๐Ÿ—
View GitHub Profile
@subfuzion
subfuzion / redis-autostart-osx.md
Last active April 26, 2024 21:40
redis auto start OS X

Install with Homebrew

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)

@stongo
stongo / app.js
Last active September 7, 2024 14:28
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
@mikevalstar
mikevalstar / GetRFC822Date.js
Created April 17, 2012 17:58
RSS 2.0 Jade Template
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){
@tkihira
tkihira / gist:2367067
Created April 12, 2012 13:02
rmdir recursively in node.js
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 == "..") {