Skip to content

Instantly share code, notes, and snippets.

View kachok's full-sized avatar

Dmitry Kachaev kachok

View GitHub Profile
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@kachok
kachok / turk.js
Created March 20, 2012 20:08 — forked from longouyang/turk.js
Small helper file for doing external HITs on Mechanical Turk
var turk = {};
(function() {
var param = function(url, name ) {
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
return ( results == null ) ? "" : results[1];
}
@kachok
kachok / gist:1376975
Created November 18, 2011 16:35 — forked from defnull/gist:1224387
Deploy a Bottle app on Heroku
mkdir heroku
cd heroku/
virtualenv --no-site-packages env
source env/bin/activate
pip install bottle gevent
pip freeze > requirements.txt
cat >app.py <<EOF
import bottle
import os