Skip to content

Instantly share code, notes, and snippets.

vperron /
Created August 17, 2013 10:46 — forked from enjalot/
Added OPTIONS handling, works far better !
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_OPTIONS(self):
self.send_response(200, "ok")
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
self.send_header("Access-Control-Allow-Headers", "X-Requested-With")
def send_head(self):
vperron /
Last active December 22, 2015 09:29
Export Google Reader XML posts to Jekyll post template.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import errno
from string import Template
from slugify import slugify
from xml.dom.minidom import parse
vperron / bower.json
Last active December 26, 2015 04:39 — forked from brcharron/leaflet-google.js
Leaflet Google plugin (with bower.json)
"name": "leaflet-google",
"version": "0.0.1",
"_release": "0.01",
"main": "./leaflet-google.js",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "a7c205f84f8dcc60c8c5ab4ac453930810d39b15"
vperron /
Created March 21, 2014 03:18
HAR Player - replay your browser's HAR files
#!/usr/bin/env python
Use it with python <file.har> <*ports>
vperron /
Created January 23, 2015 16:51
vperron / gist:9db66663de0767ca046b
Created March 9, 2015 14:22
# simple uWSGI upstart job
description "uWsgi server for {{ }}"
start on runlevel [2345]
stop on runlevel [06]
{% include "templates/env_vars.j2" %}

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

import sys
# Keeps ordering
import ruamel.yaml
with open(sys.argv[1], 'r') as f:
data = ruamel.yaml.load(, ruamel.yaml.RoundTripLoader)
lst = []
for svc in data['services']:

Keybase proof

I hereby claim:

  • I am vperron on github.
  • I am mrnicehands ( on keybase.
  • I have a public key whose fingerprint is 1729 5CA4 D494 845D 00D2 724B 85D4 2918 15E6 89A5

To claim this, I am signing this object:

# Add this to your bashrc to get 'git branch'-like completion:
# _git_polypush()
# {
#  _git_branch
# }
set -xe # fail on first error