Skip to content

Instantly share code, notes, and snippets.

View nickelser's full-sized avatar
🚿
in the shower

Nick Elser nickelser

🚿
in the shower
View GitHub Profile
@nickelser
nickelser / exit_handler.rb
Created July 6, 2015 02:06
exit_handler monkeypatch for pool
module Celluloid
module Supervision
class Container
# Manages a fixed-size pool of actors
# Delegates work (i.e. methods) and supervises actors
# Don't use this class directly. Instead use MyKlass.pool
class Pool
def initialize(options={})
@idle = []
@busy = []

Generate KEY and CSR:

openssl req -new -newkey rsa:2048 -nodes -keyout DOMAIN.key -out DOMAIN.csr

Echo the KEY in PEM format:

openssl rsa -in DOMAIN.key -outform PEM

Echo the CRT in PEM format:

# http://www.evanmiller.org/bayesian-ab-testing.html implemented in ruby
# requires the distribution gem from https://github.com/clbustos/distribution (gem 'distribution', require: false)
def probability_b_beats_a(completed_a, total_a, completed_b, total_b)
require 'distribution/math_extension'
total = 0.0
alpha_a = completed_a + 1
beta_a = total_a - completed_a + 1
alpha_b = completed_b + 1
@nickelser
nickelser / index.html
Created November 29, 2012 00:58
awesome zoomable map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.background {
fill: #fff;
}
.foreground {
fill: none;