Skip to content

Instantly share code, notes, and snippets.

View TheSeamau5's full-sized avatar

Hassan Hayat TheSeamau5

  • Entrepreneur
  • Austin, TX
View GitHub Profile
@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 --
@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 / 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
import Html exposing (Html)
import Html.Attributes
import Time
import Mouse
import Signal
-----------
infixl 2 =>
(=>) = (,)
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
type alias Spring a =
{ stiffness : Float
, friction : Float
, position : a
, velocity : a
, destination : a
}
@TheSeamau5
TheSeamau5 / mappablespringanimations.elm
Last active December 15, 2015 19:42
Mappable Spring Animations
import Html exposing (Html)
import Html.Attributes
import Time
import Mouse
import Signal
-----------
infixl 2 =>
(=>) = (,)
@TheSeamau5
TheSeamau5 / monadicsprings.elm
Created July 10, 2015 20:58
Monadic springs
import Html exposing (Html)
import Html.Attributes
import Time
import Mouse
import Signal
-----------
infixl 2 =>
(=>) = (,)
@TheSeamau5
TheSeamau5 / ScrollList.elm
Last active August 29, 2015 14:25
Scroll List in Elm
import Html exposing (Html, Attribute)
import Html.Attributes
import Html.Events
import Json.Decode exposing (Decoder, (:=))
import List
import Signal exposing (Address)
import StartApp
import Array exposing (Array)
import Window
import Graphics.Element exposing (show)
type Mappable a b ma mb = Mappable
{ map : (a -> b) -> ma -> mb }
map : (a -> b) -> ma -> { ext | mappable : Mappable a b ma mb } -> mb
map f m {mappable} = case mappable of
Mappable {map} -> map f m