Skip to content

Instantly share code, notes, and snippets.

var staticProvider = express.static(...);
app.get('*', function(req, res, next){
staticProvider(req, res, function(err){
if (err) return next(err);
// oh nodes, didn't find it
});
});
@c00kiemon5ter
c00kiemon5ter / post-commit
Created June 1, 2011 16:17
a hook to deploy static generated sites
#!/usr/bin/env bash
# executables prefix
_prefix="/usr/bin"
# git executable
_git="$_prefix/git"
# site generation executable
_generate="$_prefix/jekyll"
# options for the generator
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@ashrithr
ashrithr / kafka.md
Last active March 14, 2024 21:16
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@briankung
briankung / docker-pry-rails.md
Last active September 30, 2024 06:55
Using pry-rails with Docker