Skip to content

Instantly share code, notes, and snippets.

@pdamoc
pdamoc / Tangram.elm
Created December 6, 2015 16:12
Tangram Animation
import Svg exposing (svg, path, g, text, text', rect)
import Svg.Attributes exposing (width, height, viewBox, fill, transform, d, x, y, rx, ry, style, textAnchor)
import Easing exposing (ease, easeOutElastic, float)
import Effects exposing (Effects)
import Html exposing (Html)
import Svg.Events exposing (onClick)
import Time exposing (Time, second)
import StartApp
import Task
@pdamoc
pdamoc / MockRequests.elm
Created October 29, 2015 11:46
A strategy to decouple the requests from the rest o the app in order to facilitate mock results.
import Html exposing (..)
import Html.Attributes exposing (style, id, type', src)
import Html.Events exposing (onClick)
import Task exposing (Task, succeed)
import StartApp
import Effects exposing (Never)
import Json.Decode exposing ( (:=), string )
import Http exposing (send, Request, empty, defaultSettings, fromJson )
import Task exposing (andThen)
@pdamoc
pdamoc / README.md
Last active March 26, 2016 18:11
Integrating ports with Elm Architecture

Instructions

  • compile the SendToPort.elm to elm.js
    elm-make SendToPort.elm --output elm.js
  • open SendToPort.html

Observations

@pdamoc
pdamoc / StartApp.elm
Created September 26, 2015 11:04
Agnostic StartApp
module StartApp ( start, Config, App ) where
{-| This module helps you start your application in a typical Elm workflow.
It assumes you are following [the Elm Architecture][arch] and using
[elm-effects][]. From there it will wire everything up for you!
**Be sure to [read the Elm Architecture tutorial][arch] to learn how this all
works!**
[arch]: https://github.com/evancz/elm-architecture-tutorial
[elm-effects]: http://package.elm-lang.org/packages/evancz/elm-effects/latest
@pdamoc
pdamoc / SlideShow.elm
Last active September 9, 2015 07:29
SlideShow delayed action
module SlideShow where
import StartApp
import Time exposing (second, Time)
import Html exposing (Html, Attribute, div, text)
import Html.Attributes exposing (style)
import Effects exposing (Effects, map, batch, Never)
import Array exposing (get, fromList)
import Task
import Mouse
@pdamoc
pdamoc / ZipCodes.elm
Created September 8, 2015 07:59
ZipCodes demo updated to user the Elm Architecture
module ZipCodes where
import Effects exposing (Effects, map, batch, Never)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode as Json exposing ((:=))
import Task
import String
import Char