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
| export function canExecuteFastAttack(knightIsAwake) { | |
| return knightIsAwake ? false : true | |
| } | |
| export function canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake) { | |
| if(knightIsAwake || archerIsAwake || prisonerIsAwake) { | |
| return true; | |
| } | |
| return false; | |
| } |
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
| export const PREPARATION_MINUTES_PER_LAYER = 2; | |
| export const EXPECTED_MINUTES_IN_OVEN = 40; | |
| export function remainingMinutesInOven(actualMinutesInOven) { | |
| return EXPECTED_MINUTES_IN_OVEN - actualMinutesInOven | |
| } | |
| export function preparationTimeInMinutes(numberOfLayers) { | |
| return PREPARATION_MINUTES_PER_LAYER * numberOfLayers | |
| } |
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 CursosWeb.Router do | |
| use CursosWeb, :router | |
| import CursosWeb.UserAuth | |
| pipeline :browser do | |
| plug :accepts, ["html"] | |
| plug :fetch_session | |
| plug :fetch_live_flash | |
| plug :put_root_layout, {CursosWeb.Layouts, :root} |
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 CursosWeb.UserAuth do | |
| use CursosWeb, :verified_routes | |
| import Plug.Conn | |
| import Phoenix.Controller | |
| alias Cursos.Accounts | |
| # Make the remember me cookie valid for 60 days. | |
| # If you want bump or reduce this value, also change |
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 Friends.Application do | |
| # See https://hexdocs.pm/elixir/Application.html | |
| # for more information on OTP Applications | |
| @moduledoc false | |
| use Application | |
| @impl true | |
| def start(_type, _args) do | |
| children = [ |
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
| iex> alias Friends.{Movie, Character, Repo} | |
| iex> movie = %Movie{title: "Ready Player One", tagline: "Something about video games"} | |
| %Friends.Movie{ | |
| __meta__: %Ecto.Schema.Metadata<:built, "movies">, | |
| actors: %Ecto.Association.NotLoaded<association :actors is not loaded>, | |
| characters: %Ecto.Association.NotLoaded<association :characters is not loaded>, | |
| distributor: %Ecto.Association.NotLoaded<association :distributor is not loaded>, | |
| id: nil, |
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
| *Pré requisitos ********* | |
| => git instalado | |
| => heroku cli instalado | |
| => aplicação gerenciada pelo git | |
| ************************* | |
| #Login no heroku | |
| heroku login | |
| #Criando aplicação |