Skip to content

Instantly share code, notes, and snippets.

@tanukesensei
tanukesensei / Infiltration_challenge.js
Last active February 22, 2023 22:00
Annalyn's Infiltration
export function canExecuteFastAttack(knightIsAwake) {
return knightIsAwake ? false : true
}
export function canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake) {
if(knightIsAwake || archerIsAwake || prisonerIsAwake) {
return true;
}
return false;
}
@tanukesensei
tanukesensei / Lasagna_challenge.js
Last active February 22, 2023 21:59
Lucian's Luscious Lasagna
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
}
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}
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
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 = [
@tanukesensei
tanukesensei / gist:e09c83c54fdb9df7b8200f237d4e3ca2
Last active November 23, 2022 14:27
Erro ao inserir um filme pelo iex
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,
@tanukesensei
tanukesensei / Deploy heroku - laravel
Created November 1, 2018 17:17 — forked from trgomes/Deploy heroku - laravel
Deploy de uma aplicação laravel no heroku
*Pré requisitos *********
=> git instalado
=> heroku cli instalado
=> aplicação gerenciada pelo git
*************************
#Login no heroku
heroku login
#Criando aplicação