This file contains hidden or 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(test). | |
-export([add/2]). | |
add(X,Y) -> X + Y. |
This file contains hidden or 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 Test do | |
def add(x, y) do | |
x + y | |
end | |
end |
This file contains hidden or 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 ElixirUseSheriff.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :elixir_use_sheriff, | |
version: "0.0.1", | |
elixir: "~> 1.0", | |
build_embedded: Mix.env == :prod, | |
start_permanent: Mix.env == :prod, | |
deps: deps] |
This file contains hidden or 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 ElixirUseSheriff do | |
@type colors() :: :blue | :red | :green | :yellow | |
def test(value) do | |
:sheriff.check(value, {:blue, :red, :green, :yellow}) | |
end | |
end |
This file contains hidden or 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 PhoenixBbs.Router do | |
use PhoenixBbs.Web, :router | |
pipeline :browser do | |
plug :accepts, ["html"] | |
plug :fetch_session | |
plug :fetch_flash | |
plug :protect_from_forgery | |
end |
This file contains hidden or 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 PhoenixBbs.BbsController do | |
use PhoenixBbs.Web, :controller | |
plug :action | |
def index(conn, _params) do | |
docs = Mongo.connect! | |
|> Mongo.db("phoenix_bbs") | |
|> Mongo.Db.collection("comments") | |
|> Mongo.Collection.find |
This file contains hidden or 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 PhoenixBbs.BbsView do | |
use PhoenixBbs.Web, :view | |
end |
This file contains hidden or 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
<div class="jumbotron"> | |
<h2>Welcome to Phoenix BBS!</h2> | |
</div> | |
<div> | |
<table> | |
<%= for comment <- @comments do %> | |
<tr> | |
<td>name: <%= comment[:name] %></td> | |
<td>title: <%= comment[:title] %></td> |
This file contains hidden or 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 PhoenixBbs.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :phoenix_bbs, | |
version: "0.0.1", | |
elixir: "~> 1.0", | |
elixirc_paths: elixirc_paths(Mix.env), | |
compilers: [:phoenix] ++ Mix.compilers, | |
build_embedded: Mix.env == :prod, |
This file contains hidden or 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 TrotSample.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :trot_sample, | |
version: "0.0.1", | |
elixir: "~> 1.0", | |
build_embedded: Mix.env == :prod, | |
start_permanent: Mix.env == :prod, | |
deps: deps] |