Skip to content

Instantly share code, notes, and snippets.

http://realtime-chat-sample.herokuapp.com/
# secret key
openssl genrsa 2048 > server.key
# certificate signing request
openssl req -new -key server.key <<EOF > server.csr
JP
Tokyo
Chiyoda
company
require 'test/unit'
class TestEditControl < Test::Unit::TestCase
server = '172.17.0.2'
cipher_list = ['RC4-MD5', 'ECDHE-RSA-AES128-GCM-SHA256']
cipher_list.each do |cipher|
test cipher do
result = `openssl s_client -connect #{server}:443 -cipher #{cipher} < /dev/null`
assert_not_match /New, \(NONE\), Cipher is \(NONE\)/m, result
# % tree
# .
# ├── Thorfile
# ├── json
# └── template
# └── hello.json.tt
# $ thor hello:hello
# hello
# create node/hello.json
module M
def asdf
p 'asdf'
end
end
module M_
extend M
end
defmodule Ticker do
@interval 2000
@name :ticker
def start do
pid = spawn __MODULE__, :generator, [[]]
:global.register_name(@name, pid)
end
def register(client_pid) do
defmodule Sort do
import List
import Enum
def bubble_sort([]), do: []
def bubble_sort(list), do: bubble_sort_(bubble(list))
def bubble_sort_([]), do: []
def bubble_sort_(list), do: bubble_sort(take(list, length(list)-1)) ++ [last list]
-- N^2 ~ N
f (x, y) = (((x+y)*(x+y+1))/2) + x + 1
a n = b (0, n)
b (x, 0) = [(x, 0)]
b (x, y) = (x, y) : b (x+1, y-1)
app n = map f ([0..n] >>= a)
-- P(x, y) <=> x < y
-- f(x, y) = (μz < y)[P(x, z)]
p x y = x < y
f x 0 = 0
f x y = h x (y-1) (f x (y-1))
h x y g | g < y = f x y
| g == y && p x y = y
| otherwise = y + 1
Definition obj := Type.
Inductive map : Type :=
| Id : obj -> map
| Diff : obj -> obj -> map
| Comp : map -> map -> map.
Inductive hom : map -> obj -> obj -> Prop :=
| HomId : forall f a,
f = Id a -> hom f a a