Skip to content

Instantly share code, notes, and snippets.

Petre Damoc pdamoc

Block or report user

Report or block pdamoc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pdamoc
pdamoc / ZipCodes.elm
Created Sep 8, 2015
ZipCodes demo updated to user the Elm Architecture
View ZipCodes.elm
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
@pdamoc
pdamoc / SlideShow.elm
Last active Sep 9, 2015
SlideShow delayed action
View SlideShow.elm
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 / StartApp.elm
Created Sep 26, 2015
Agnostic StartApp
View StartApp.elm
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 / README.md
Last active Mar 26, 2016
Integrating ports with Elm Architecture
View README.md

Instructions

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

Observations

@pdamoc
pdamoc / MockRequests.elm
Created Oct 29, 2015
A strategy to decouple the requests from the rest o the app in order to facilitate mock results.
View MockRequests.elm
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 / Tangram.elm
Created Dec 6, 2015
Tangram Animation
View Tangram.elm
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
View TurnBase.elm
module TurnBase (Model, Action, init, update, view, main) where
import Effects exposing (Effects)
import Html exposing (Html)
import Svg exposing (svg, rect, g, text, text')
import Svg.Attributes exposing (..)
import Svg.Events exposing (onClick)
import Time exposing (Time, second)
import StartApp
import Task exposing (Task)
@pdamoc
pdamoc / Components.elm
Created Dec 8, 2015
Alternative Component Architecture
View Components.elm
import Html exposing (..)
import Html.Attributes exposing (width, style)
import StartApp
import Effects exposing (Effects)
import Task exposing (Task)
import Time exposing (Time)
type MainAction = Sidebar Html | Content Html
View RandomDemo.elm
module RandomDemo where
import Html exposing (..)
import Html.Events exposing (onClick)
import Random exposing (int, generate)
import StartApp
import Effects exposing (Effects)
View Game.elm
module Game where
import Effects exposing (Effects, Never)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import String
import Time
import Task
import Random exposing (generate, int, initialSeed)
You can’t perform that action at this time.