Skip to content

Instantly share code, notes, and snippets.

@pdamoc
pdamoc / Basic.elm
Created June 20, 2017 08:51
Styles isolation
module Main exposing (..)
import Element exposing (..)
import Element.Attributes exposing (..)
import BasicStyles exposing (..)
{-| A synonym for creating tuples. This will be included in the standard library soon.
1 => 2 == (1, 2)
@pdamoc
pdamoc / Counter.elm
Last active October 10, 2016 12:26
Multi component elm
port module Counter exposing (..)
import Html exposing (..)
import Html.App exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode as Json exposing (Value)
type alias Model =
@pdamoc
pdamoc / CounterList.elm
Created August 30, 2016 07:36
CounterList Example without nesting.
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
App.beginnerProgram
@pdamoc
pdamoc / Print2.elm
Created July 18, 2016 11:06
Svg Error
module Print2 exposing (..)
import Html exposing (div, button, text, body, iframe)
import Html.Attributes as A
import Html.App as App
import Html.Events exposing (onClick)
import Svg exposing (..)
import Svg.Attributes exposing (..)
import VirtualDom exposing (..)
import String
@pdamoc
pdamoc / App.elm
Last active June 9, 2021 15:50
Demo on how to split code across multiple pages.
module Main exposing (..)
import Html exposing (Html, div, hr, text)
import Html.App as App
import Navigation
-- APP IMPORTS
import FirstPage
@pdamoc
pdamoc / Sam.elm
Created June 21, 2016 09:15
update to valid data
import Html exposing (..)
import Html.App as App
import Html.Events exposing (on, onClick)
import Html.Attributes exposing (style)
import Mouse exposing (Position)
import Json.Decode as Json
-- MODEL
@pdamoc
pdamoc / Sam.elm
Created June 21, 2016 08:01
Another SAM approach
import Html exposing (..)
import Html.App as App
import Html.Events exposing (on, onClick)
import Html.Attributes exposing (style)
import Mouse exposing (Position)
import Json.Decode as Json
-- MODEL
@pdamoc
pdamoc / Main2.elm
Created June 17, 2016 15:26
SAM with AnimationFrame
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Events exposing (onClick)
import AnimationFrame
import Time exposing (Time, second)
-- MODEL
@pdamoc
pdamoc / Child.elm
Created June 3, 2016 10:09
Child 2 Child Communication.
module Child exposing (..)
import Html exposing (..)
import Html.Attributes exposing (value)
import Html.Events exposing (on, onClick, targetValue)
import Json.Decode as Json
-- MODEL
@pdamoc
pdamoc / Main.elm
Created May 31, 2016 19:35
Req msg with cache
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Events exposing (onClick)
import Req exposing (..)
import Dict exposing (Dict)
main : Program Never