Skip to content

Instantly share code, notes, and snippets.

View pootsbook's full-sized avatar

Philip Poots pootsbook

  • ClubCollect
  • Alphen aan den Rijn, NL
View GitHub Profile
@robertknight
robertknight / elm-setup-notes.md
Created November 14, 2015 07:29
Elm setup notes

Elm Tutorial Notes

  1. Went to elm-lang hopepage, skimmed the initial instructions, went for the Install option so I could develop in my preferred editor (Atom).
  2. Not obvious where to go next after that, went to the Docs link at the top. Was expecting to find an 'Intro to Elm' guide. In lieu of that, picked the next most obvious thing which was walking through the Quick Start links.
@berndca
berndca / HttpAction.elm
Last active January 21, 2016 17:43
Http.getString at startup
import StartApp
import Http
import Markdown
import Html exposing (Html, div, button, text)
import Html.Events exposing (onClick)
import Task exposing (Task)
import Effects exposing (Effects)
-- the URL of the README.md that we desire
readmeUrl : String
@staltz
staltz / migration-guide.md
Last active December 19, 2023 22:14
How to show migration guides in GitHub Markdown

How to show migration guides in GitHub Markdown

Use the diff code highlighting tag.

  ```diff
  - foo
  + bar

Example:

module Main where
import Signal
import Time exposing (Time, millisecond)
import String
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Effects exposing (Never, Effects)
@manigandham
manigandham / rich-text-html-editors.md
Last active May 3, 2024 19:37
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@JoshCheek
JoshCheek / learning_elm.md
Last active February 18, 2017 22:50
Learning Elm

Learning Elm

What is it? (20 min)

Glance through a few of the examples, maybe 5 or so, to see what kinds of things Elm is doing, what domains they're in, what the code looks like, what other people think Elm is.

-- interface is a more familiar name for the intention of the construct
type alias Append a rest = { rest | append : a -> a -> a}
-- implement is a more familiar name
stringAppend rest = {rest | append = \x y -> x ++ y}
-- this is Monoid
type alias AppendWithId a rest = Append a {rest | id : a}
-- ^ 1 potential superclass
@mgold
mgold / SuperTimer.elm
Created February 12, 2016 14:40 — forked from shamrin/SuperTimer.elm
Restartable timer
module SuperTimer where
import Html exposing (..)
import Html.Events exposing (onClick)
import Time exposing (Time)
import Signal exposing (Address)
type Action = Tick Time | Toggle Bool | NoOp
type alias Model = { running: Bool, count: Float}
@yang-wei
yang-wei / destructuring.md
Last active February 20, 2024 04:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@yang-wei
yang-wei / decode.md
Last active April 2, 2024 20:18
Elm Json.Decode tutorial and cheatsheet

When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.

I like to follow working example code so this is how the boilerplate will look like:

import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))

import Http