This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.
publish message to foo
channel from user nickname
.
$ python pub.py foo nickname
PUBLISH to channel #foo
# 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 |
graph = {} | |
ObjectSpace.each_object(Class) do |klass| | |
sup = klass.superclass and graph[klass] = sup | |
end | |
puts "digraph{overlap=false;" | |
graph.map do |key, value| | |
puts %("#{key}"\n"#{key}"->"#{value}") | |
end | |
puts"}" |
#!/bin/bash | |
function today { | |
echo `date +"%Y%m%d"` | |
} | |
function last_tag_today { | |
output=`git tag` | |
local last_today='' |