Skip to content

Instantly share code, notes, and snippets.

View bcks's full-sized avatar

John Emerson bcks

View GitHub Profile
@bcks
bcks / proxy.js
Created October 22, 2013 19:42
Node Proxy with http to https redirect and SSL certificate bundle
#!/usr/bin/env /YOUR/PATH/TO/node
var httpProxy = require('http-proxy'),
fs = require('fs'),
options;
require("http").createServer(function(req, res){
res.writeHead(301, {
'Content-Type': 'text/plain',
'Location':'https://' + req.headers.host.replace(/^www\./, '') + req.url });
@bcks
bcks / svg2raphael.js
Last active April 4, 2023 10:02
Convert SVG to Raphael.js
#!/usr/bin/perl
#
# Useful for making maps like the one at http://backspace.com/mapapp/javascript_world
#
use XML::TreeBuilder;