import IEx.Helpers
Mix.install([
{:kino, "~> 0.12.2"}
])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* see more at grox.io */ | |
different(red, green). different(red, blue). | |
different(green, red). different(green, blue). | |
different(blue, red). different(blue, green). | |
coloring(Alabama, Mississippi, | |
Georgia, Tennessee, Florida) :- | |
different(Mississippi, Tennessee), |
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
/* caller must hold instance lock */ | |
static int reset_hardware(...) {...} | |
static_int_in2000_bus_reset(...) { | |
... | |
reset_hardware( … ); | |
... | |
} | |
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
test "chat" do | |
bucket = create_bucket | |
assert %{__struct__: "Bucket"} = bucket | |
assert Bucket.empty?(bucket) | |
Bucket.add(bucket, 1) | |
assert bucket.contents == [1] | |
end | |
# instead |
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
test "chat" do | |
chat = Chat.create(...) | |
assert chat != nil | |
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
setup do | |
# universal setup | |
end | |
test "a get" do | |
... | |
end | |
test "logged in get" do | |
login_user |
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 Chat.Mixfile do | |
defp deps do | |
[{:excoveralls, only: :test}] | |
end | |
defp test(args) do | |
... | |
Mix.Task.run("test") | |
Mix.shell.info("") |
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
receive :start, %{room: room_name, email: email} do | |
# ... | |
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
def recv(%{"type" => "start", "room" => room_name, "email" => email}, conn, s) do | |
# ... | |
end |
NewerOlder