Skip to content

Instantly share code, notes, and snippets.

View rundis's full-sized avatar

Magnus Rundberget rundis

View GitHub Profile
@rundis
rundis / Posts.elm
Created March 8, 2016 19:57
elmdecoding
module Posts (..) where
import Comment exposing (..)
import Effects exposing (Effects, Never)
import Html exposing (..)
import Html.Events exposing (..)
import Http
import Json.Decode as Decode exposing (Decoder, (:=))
import List exposing (..)
import Post exposing (..)
@rundis
rundis / Freehand.elm
Created March 28, 2016 22:36
Elm svg freehand
module Freehand where
import String
import List
import Svg
import Svg.Attributes exposing (..)
import Html exposing (Html)
import Html.Events exposing (onClick)
import Effects exposing (Effects)
import StartApp
@rundis
rundis / Sample gist
Created April 14, 2016 08:49
Howto gist...
case action of
SomeAction ->
({model | field = model.field +1}, Effects.none)
-- etc
@rundis
rundis / Sample.elm
Created April 30, 2016 11:31
Reversing a string using a stack
module Sample where
import Stack exposing (..)
import String
import Html exposing (..)
reverseString : String -> String
reverseString str =
String.split "" str
|> Stack.fromList
@rundis
rundis / View.elm
Created January 21, 2017 11:39
elm - height of element in click handler
import DOM -- From debois/elm-dom
view state config =
div [ class "main" ]
[ div [ class "nav"]
[ button
[ myClickHandler state config] -- When clicking on the button I want to get the height of element with class "displayBlock"
[ text "MyButton" ]
div
@rundis
rundis / elm-light-features.md
Last active March 8, 2017 00:32
elm-light (Elm Light Table plugin) - Feature overview

Features

  • Jump to definition
    • Uses Knowledge about all top level functions/values, type aliases and ADTs.(including 3rd party) Needs file and location info
  • Show doc and type annotations
    • Uses: Same as jump to + raw doc strings (and type info where applicable)
  • Context sensitive autocompletions
    • Uses: Same as jump to + all modules + what they expose + details about params / destructured params and aliases
    • Wants: Details about function bodies symbols (let blocks, pattern matches etc etc)
  • Find symbol
package no.routehandling.utils
import arrow.core.Either
import arrow.core.flatMap
import arrow.core.raise.either
import arrow.core.raise.ensureNotNull
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.server.response.*