Skip to content

Instantly share code, notes, and snippets.

View hpoom's full-sized avatar

Simon Wood hpoom

View GitHub Profile
@hpoom
hpoom / gist:4056329
Created November 11, 2012 21:29 — forked from anonymous/gist:4055232
How to set a property in express scoped to each request
// When setting up your application define what you need using
// http://expressjs.com/api.html#app.use
// In this case we are creating an instance of 'Bar'
app.use(function( req, res, next ) {
res.locals.foo = 1;
next();
});
// Later on in your routes you have access to the instance of 'Bar'
@hpoom
hpoom / orchestra-temp-upload.php
Created February 1, 2012 15:41 — forked from kevinholler/orchestra-temp-upload.php
WordPress plugin for Orchestra.io to set the upload path to sys_get_temp_dir().
<?php
/*
Plugin Name: Orchestra.io Upload to Temp
Plugin URI:
Description: Sets the upload path to sys_get_temp_dir(), allowing uploads to be stored temporarily, presumably before being moved elsewhere (like Amazon S3 via the tantan-s3 plugin).
Version: 0.1
Author: Dylan Kuhn
Author URI: http://www.cyberhobo.net/
Minimum WordPress Version Required: 3.0
License: GPL2+