Skip to content

Instantly share code, notes, and snippets.

$("#media_items").html5Uploader({
url: "<%= assets_path %>",
method: 'POST',
params: {
authenticity_token: "<%= form_authenticity_token %>"
}
});
@melito
melito / html5uploader.coffee
Created March 18, 2012 05:20
Coffee Script html5 uploader
class HTML5Uploader
constructor:(obj, options) ->
@method = options['method'] ||= "POST"
@url = options['url'] ||= "/"
@params = options['params']
@obj = $(obj)
@files = []
@alerted = false
@melito
melito / gist:3153481
Created July 20, 2012 21:48 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt

This is a temporary workaround to have etcd listening on all interfaces so you can access it from docker containers.

Add a local etcd unit file

Create a file called /media/state/units/etcd-local.service that has the following contents:

[Unit]
Description=etcd local

Install python env

On macOS the system python crashes with weird bugs.

You get around that using virtualenv and python 2.7

Here's what I did