Skip to content

Instantly share code, notes, and snippets.

@BloodAxe
BloodAxe / setup.sh
Last active January 3, 2018 15:59
Configure DigitalOcean Droplet for cloud image processing
# Prepare system
apt-get update
apt-get upgrade
apt-get install build-essential
apt-get install cmake
apt-get install git
apt-get install pkg-config
# Grab frest opencv library
curl -sL https://github.com/Itseez/opencv/archive/master.zip > opencv.zip
@davemo
davemo / api.proxy.server.js
Created November 6, 2012 21:56
A simple express.js server with a proxy that intercepts all requests with /api/ and proxies them to localhost:3000
var express = require('express'),
httpProxy = require('http-proxy'),
app = express();
var proxy = new httpProxy.RoutingProxy();
function apiProxy(host, port) {
return function(req, res, next) {
if(req.url.match(new RegExp('^\/api\/'))) {
proxy.proxyRequest(req, res, {host: host, port: port});