Skip to content

Instantly share code, notes, and snippets.

View TheSeamau5's full-sized avatar

Hassan Hayat TheSeamau5

  • Entrepreneur
  • Austin, TX
View GitHub Profile
module Todo where
{-| TodoMVC implemented in Elm, using plain HTML and CSS for rendering.
This application is broken up into four distinct parts:
1. Model - a full definition of the application's state
2. Update - a way to step the application state forward
3. View - a way to visualize our application state with HTML
4. Inputs - the signals necessary to manage events
This clean division of concerns is a core part of Elm. You can read more about
this in the Pong tutorial: http://elm-lang.org/blog/Pong.elm
This program is not particularly large, so definitely see the following
import Html exposing (Html)
import Html.Attributes
import Time
import Mouse
import Signal
-----------
infixl 2 =>
(=>) = (,)
@TheSeamau5
TheSeamau5 / todomvcrewrite.elm
Created July 10, 2015 11:17
Todo MVC Rewrite with field setter syntax
module Todo where
{-| TodoMVC implemented in Elm, using plain HTML and CSS for rendering.
This application is broken up into four distinct parts:
1. Model - a full definition of the application's state
2. Update - a way to step the application state forward
3. View - a way to visualize our application state with HTML
4. Inputs - the signals necessary to manage events
This clean division of concerns is a core part of Elm. You can read more about
this in the Pong tutorial: http://elm-lang.org/blog/Pong.elm
This program is not particularly large, so definitely see the following
@TheSeamau5
TheSeamau5 / tabs.elm
Created July 7, 2015 03:35
Care for some tabs?
import Html exposing (Html)
import Html.Attributes
import Html.Events
import Signal exposing (Address)
import Window
import Color exposing (Color)
------------
type alias Vector =
{ x : Float , y : Float }
@TheSeamau5
TheSeamau5 / multipageform.elm
Last active October 30, 2020 16:54
Simple multi-page form
import Html exposing (Html, Attribute)
import Html.Attributes
import Html.Events
import Signal exposing (Address)
import List
import String
import StartApp
------------------
--- HELPER CODE --
import Html exposing (Html)
import Html.Attributes
import Html.Events
import Signal exposing (Address)
import Json.Decode exposing (Decoder, (:=))
import List
-------
import Html exposing (Html)
import Html.Attributes
import Signal exposing (Address)
import List
infixl 2 =>
(=>) = (,)
type alias Vector =
{ x : Float , y : Float }
import Html exposing (Html)
import Html.Attributes
import Html.Events
import Signal exposing (Address)
import List
import Window
-----------------
-- HELPER CODE --
@TheSeamau5
TheSeamau5 / draggabledivs.elm
Created June 29, 2015 17:30
Draggable divs
import Html exposing (Html, Attribute)
import Html.Attributes
import Html.Events
import Signal exposing (Address, Message)
import List
import Json.Decode exposing (Decoder, (:=))
-------------------
--- HELPER CODE ---
-------------------
nth : Int -> List a -> Maybe a
@TheSeamau5
TheSeamau5 / littlejsonencoder.elm
Created June 22, 2015 20:37
Little JSON encoder
import String
import List
infixl 2 =>
(=>) = (,)
type Json
= Number Float
| String String