This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://realtime-chat-sample.herokuapp.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# secret key | |
openssl genrsa 2048 > server.key | |
# certificate signing request | |
openssl req -new -key server.key <<EOF > server.csr | |
JP | |
Tokyo | |
Chiyoda | |
company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# % tree | |
# . | |
# ├── Thorfile | |
# ├── json | |
# └── template | |
# └── hello.json.tt | |
# $ thor hello:hello | |
# hello | |
# create node/hello.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module M | |
def asdf | |
p 'asdf' | |
end | |
end | |
module M_ | |
extend M | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer