Skip to content

Instantly share code, notes, and snippets.

@pdamoc
pdamoc / Main.elm
Created May 31, 2016 18:33
Req msg instead of Cmd msg
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Events exposing (onClick)
import Req exposing (..)
main : Program Never
main =
@pdamoc
pdamoc / Main.elm
Last active June 17, 2016 15:11
SAM in Elm
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Events exposing (onClick)
import Time
-- MODEL
@pdamoc
pdamoc / RandomGif.elm
Last active May 24, 2016 06:32
Chain Html.App.map Error - Start from WidgetList.elm
module RandomGif exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import Http
import Json.Decode as Json
import Task
@pdamoc
pdamoc / Component.elm
Created May 20, 2016 20:48
Counters through JS
module Component exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import Ports exposing (..)
-- MODEL
@pdamoc
pdamoc / Component.elm
Last active June 27, 2016 08:09
Counter through JS
module Component exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import Ports exposing (..)
-- MODEL
@pdamoc
pdamoc / RelativeMouse.elm
Created May 20, 2016 07:33
Relative Mouse Position
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Mouse exposing (Position)
import Window exposing (Size)
import Task
-- MODEL
plottingSize = Size 600 400
@pdamoc
pdamoc / Counter.elm
Last active May 19, 2016 20:37
Widget Union
module Counter exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
-- MODEL
type alias Model = Int
@pdamoc
pdamoc / Flexy.elm
Created May 16, 2016 07:38
Flex layout helper
module Flexy
( Design, design
, row, column, rowReverse, columnReverse
, wrap, wrapReverse, noWrap
, justifyStart, justifyCenter, justifyEnd, justifyBetween, justifyAround
, alignItemsStart, alignItemsCenter, alignItemsEnd
, alignItemsStretch, alignItemsBaseline
, alignContentStart, alignContentCenter, alignContentEnd, alignContentStretch
, alignContentBetween, alignContentAround
, flex, order
@pdamoc
pdamoc / CounterSync2.elm
Created May 14, 2016 10:48
Counter Sync Version 2
import Html exposing (Html, div, button, text)
import Html.App as App exposing (beginnerProgram)
import Html.Events exposing (onClick)
import Html.Attributes exposing (style)
main : Program Never
main =
beginnerProgram { model = init 0 0 0, view = view, update = update }
-- MODEL
@pdamoc
pdamoc / CounterSync.elm
Created May 14, 2016 10:28
CounterPair in Sync
import Html exposing (Html, div, button, text)
import Html.App as App exposing (beginnerProgram)
import Html.Events exposing (onClick)
import Html.Attributes exposing (style)
main : Program Never
main =
beginnerProgram { model = init (0,0) (0,0), view = view, update = update }
-- MODEL