Skip to content

Instantly share code, notes, and snippets.

View simonh1000's full-sized avatar

Simon Hampton simonh1000

View GitHub Profile
@simonh1000
simonh1000 / ArchictectureErrorHandler.elm
Created September 23, 2015 08:06
Elm architecture example with Http (Json parsing) error handling
module ArchictectureErrorHandler where
import Text exposing (fromString)
import String
import Json.Decode as Json exposing (..)
import StartApp exposing (start)
import Html exposing (..)
import Http exposing (get, Error)
import Effects exposing (Effects)
@simonh1000
simonh1000 / Main.elm
Last active October 14, 2015 12:33
Elm 'SPA' with Google Maps on second page
module Spa where
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import StartApp
import Effects exposing (Effects, Never)
import Task
@simonh1000
simonh1000 / Main.elm
Last active July 7, 2016 12:13
Form errors
module Test exposing (..)
import Platform.Cmd exposing (Cmd)
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Form exposing (..)
import Form.Input as Input
module Test exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import List exposing (map)
import Json.Decode as Json
@simonh1000
simonh1000 / DragTable.elm
Last active June 29, 2017 12:53
Draggable table
module DragTable exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode as Json exposing (Decoder, Value)
import Dict exposing (Dict)
import List as L exposing (drop, take)
import Tuple
@simonh1000
simonh1000 / Example2.elm
Created November 26, 2016 15:51
Elm Navigation with HTML5 links
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Navigation
import Json.Decode as Json
main =
@simonh1000
simonh1000 / River.elm
Created February 14, 2018 08:22
Wolf, Goat, Cabbage problem in Elm
module River exposing (..)
type Character
= Wolf
| Goat
| Cabbage
type State