Just run this like elixir grid.exs
and you have a liveview collaborative grid huzzah
module Material.Color exposing | |
( red50, red100, red200, red300, red400, red500, red600, red700, red800, red900, redA100, redA200, redA400, redA700 | |
, pink50, pink100, pink200, pink300, pink400, pink500, pink600, pink700, pink800, pink900, pinkA100, pinkA200, pinkA400, pinkA700 | |
, purple50, purple100, purple200, purple300, purple400, purple500, purple600, purple700, purple800, purple900, purpleA100, purpleA200, purpleA400, purpleA700 | |
, deepPurple50, deepPurple100, deepPurple200, deepPurple300, deepPurple400, deepPurple500, deepPurple600, deepPurple700, deepPurple800, deepPurple900, deepPurpleA100, deepPurpleA200, deepPurpleA400, deepPurpleA700 | |
, indigo50, indigo100, indigo200, indigo300, indigo400, indigo500, indigo600, indigo700, indigo800, indigo900, indigoA100, indigoA200, indigoA400, indigoA700 | |
, blue50, blue100, blue200, blue300, blue400, blue500, blue600, blue700, blue800, blue900, blueA100, blueA200, blueA400, blueA700 | |
, lightBlue50, lightBlue100, lightBlue200, lightBlue300, li |
defmodule SomeModule do | |
def func(map, key) do | |
for {k, v} <- map, into: %{} do | |
{k, v/map[key]} | |
end | |
end | |
end | |
defmodule MapDivisionTest do | |
use ExUnit.Case |
# Hello World | |
Eve is based on the concept of a single data store that you can search in and | |
commit to. Let's start by committing a record: | |
~~~ | |
commit | |
[#greeting message: "hello world"] | |
~~~ |
module Main exposing (..) | |
import Html exposing (..) | |
import Html.Events exposing (onClick) | |
type alias Model = | |
{ count : Int | |
, increment : Int | |
, decrement : Int |
me: have you ever done the ‘make a process that runs a function that does a receive and calls that function again after receiving every message’ thing yet?
person1: that was a sentence that I have no idea what it means
me: I had already done erlang for like 3 months when I got into elixir, and kind of dug in hard on erlang, so I had these concepts in the brain already
me: ok, let me show you real quick
me: this is like the thing about elixir
NOTE: I really just want to have a discussion around this, see if someone's tried it, what dumb things I'm ignoring, etc.
update
is Msg -> Model -> (Model, Cmd Msg)
. Very often (I think every time
I've ever done anything?) I will end up with things that "update the model"
based on new Msg
(I am enjoying thinking of these as strictly events in the
EventSourcing/WAL sense), and then either some Cmd Msg
or none. Every time I
view : Model -> Html Msg | |
view model = | |
Material.Scheme.topWithScheme Color.Teal Color.LightGreen <| | |
Layout.render Mdl | |
model.mdl | |
[ Layout.fixedHeader | |
, Layout.selectedTab model.selectedTab | |
, Layout.onSelectTab SelectTab | |
] | |
{ header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Counter" ] ] |
view : Model -> Html Msg | |
view model = | |
Material.Scheme.topWithScheme Color.Teal Color.LightGreen <| | |
Layout.render Mdl | |
model.mdl | |
[ Layout.fixedHeader | |
, Layout.selectedTab model.selectedTab | |
, Layout.onSelectTab SelectTab | |
] | |
{ header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Counter" ] ] |