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 BreakoutexWeb.Live.Blocks do | |
@moduledoc """ | |
Module that contains the definitions of all the block types, | |
as well as functions to init the board | |
""" | |
# Expressed in multiple of basic units | |
@brick_length 3 | |
@spec build_board(list(list(String.t())), number(), number()) :: [map()] |
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
defp deps do | |
[ | |
# ...other deps | |
{:elixir_uuid, "~> 1.2"} | |
] | |
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
level = [ | |
~w(X X X X X X X X X X X X X X X X X X X X X X X X X X), | |
~w(X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X), | |
~w(X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X), | |
~w(X r 0 0 r 0 0 r 0 0 r 0 0 r 0 0 r 0 0 r 0 0 r 0 0 X), | |
~w(X b 0 0 b 0 0 b 0 0 b 0 0 b 0 0 b 0 0 b 0 0 b 0 0 X), | |
~w(X g 0 0 g 0 0 g 0 0 g 0 0 g 0 0 g 0 0 g 0 0 g 0 0 X), | |
~w(X o 0 0 o 0 0 o 0 0 o 0 0 o 0 0 o 0 0 o 0 0 o 0 0 X), | |
~w(X p 0 0 p 0 0 p 0 0 p 0 0 p 0 0 p 0 0 p 0 0 p 0 0 X), | |
~w(X y 0 0 y 0 0 y 0 0 y 0 0 y 0 0 y 0 0 y 0 0 y 0 0 X), |
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
WITH values as ( | |
SELECT | |
0 as value, | |
'' as label, | |
to_date('00000101','YYYYMMDD') as time | |
UNION ALL | |
SELECT | |
(close - open) / close as value, | |
to_char(time, 'Mon') || ' ' || to_char(time, 'YYYY') as label, | |
time |
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
import "../css/app.css"; | |
import { Socket } from "phoenix"; | |
import LiveSocket from "phoenix_live_view"; | |
let liveSocket = new LiveSocket("/live", Socket); | |
liveSocket.connect(); |
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
{ | |
"dependencies": { | |
"phoenix": "file:../deps/phoenix", | |
"phoenix_html": "file:../deps/phoenix_html", | |
"phoenix_live_view": "file:../deps/phoenix_live_view" | |
} | |
} |
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
config :breakoutex, BreakoutexWeb.Endpoint, | |
# ...other settings | |
live_view: [signing_salt: "SIGNING_SALT"] |
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 BreakoutexWeb.Endpoint do | |
use Phoenix.Endpoint, otp_app: :breakoutex | |
socket "/live", Phoenix.LiveView.Socket, websocket: [timeout: 45_000] | |
# ...rest of the module | |
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
pipeline :browser do | |
# ...other plugs | |
plug :fetch_flash | |
plug Phoenix.LiveView.Flash | |
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
def controller do | |
quote do | |
# ...other import/alias directives | |
import Phoenix.LiveView.Controller | |
end | |
end | |
def view do | |
quote do | |
# ...other import/alias directives |