Skip to content

Instantly share code, notes, and snippets.

@pdamoc
pdamoc / SpeedControl.elm
Last active February 14, 2016 09:11
Speed Control
import Html exposing (..)
import Html.Attributes as HA exposing (type', min, max, step)
import Html.Events exposing (..)
import Graphics.Element exposing (..)
import Time exposing (Time, millisecond)
import Color exposing (blue, white)
import StartApp
import Effects exposing (Effects, Never)
import Task exposing (Task)
import String
@pdamoc
pdamoc / TableSort.elm
Created February 16, 2016 17:15
TableSort
import Html exposing (..)
import Html.Events exposing (onClick)
import StartApp.Simple exposing (start)
-- Generic
type alias HeadItem a =
{ sorter: (a -> a -> Basics.Order)
, toHtml : (a -> Html)
@pdamoc
pdamoc / Application.elm
Created February 24, 2016 15:50
InterComponentCommunication update
module Application where
import Html exposing (..)
import Html.Events exposing (on, onClick)
import Components
import SelectedComponents
type alias Model =
{
components : List String,
@pdamoc
pdamoc / InsertHtml.elm
Created March 11, 2016 08:36
Insert Html
module InsertHtml where
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
outputMB : Signal.Mailbox String
outputMB = Signal.mailbox ""
port output : Signal String
@pdamoc
pdamoc / Mario.elm
Created May 8, 2016 20:00
Mario 0.17
import Html exposing (..)
import Keyboard
import Window exposing (Size)
import AnimationFrame
import Task
import Html.App as App
import Collage exposing (..)
import Element exposing (..)
@pdamoc
pdamoc / Pong.elm
Last active October 16, 2016 20:07
Pong Example
-- See this document for more information on making Pong:
-- http://elm-lang.org/blog/pong
import Color exposing (..)
import Collage exposing (..)
import Element exposing (..)
import Keyboard
import Text
import Time exposing (..)
import Window exposing (Size)
import Html.App as App
@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
@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 / 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 / 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