Skip to content

Instantly share code, notes, and snippets.

@dela3499
dela3499 / SpaceJumper.elm
Last active August 29, 2015 14:27
A hacked-up canvas drawing that takes advantage of easing, circles, lines, and colors. http://share-elm.com/gists/2cff87bc3a63e1f429dd
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Mouse
import Signal
import Window
import Time
import List
@dela3499
dela3499 / HypnoticFollower.elm
Last active August 29, 2015 14:27
Animated scene with trance-inducing color changes. http://share-elm.com/gists/ea4ee817db998ca5d4e0
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Color exposing (..)
import Mouse
import Signal
import Window
import Time
import List
@dela3499
dela3499 / DecodeString.elm
Last active August 29, 2015 14:27
Encode and decode strings using the simple letter-shifting cipher! http://share-elm.com/gists/adf55265598b30dd453b
import Graphics.Input.Field as Field exposing
(Content, noContent, field, defaultStyle, Direction)
import Graphics.Element as Elem exposing (..)
import Graphics.Collage exposing (..)
import Maybe exposing (withDefault)
import Color exposing (..)
import Text exposing (..)
import Dict exposing (Dict)
import Window
import String
@dela3499
dela3499 / KeyboardLayouts.elm
Last active March 8, 2016 07:22
Compare keyboard layouts to where your keystrokes go. http://share-elm.com/gists/1b632e6607a179b20dbd
import Graphics.Input.Field as Field exposing
(Content, noContent, field, defaultStyle, Direction)
import Graphics.Collage exposing (..)
import Maybe exposing (withDefault)
import Dict exposing (Dict)
import Graphics.Element as Elem exposing (..)
import Signal
import Color exposing (..)
import String
import Window
@dela3499
dela3499 / ConvertBases.elm
Created August 26, 2015 21:50
Converting to arbitrary base from base 10.
import Graphics.Element exposing (..)
import String
import Result
import Maybe exposing (withDefault)
main = show (toBase 5 147)
toBase: Int -> Int -> Int
toBase base number =
toBase' base "" number
@dela3499
dela3499 / PubmedExplorer.elm
Last active March 5, 2016 08:01
Tool to scan PubMed abstracts quickly.
import Html exposing (Html, Attribute, text, toElement, fromElement, div, input, textarea)
import Html.Attributes exposing (..)
import Html.Events exposing (on, targetValue, onClick, onDoubleClick)
import Signal exposing (Address)
import StartApp.Simple as StartApp
import String
import Graphics.Element exposing (spacer, color, show)
import Color exposing (..)
import Dict exposing (Dict)
import Maybe exposing (withDefault)
@dela3499
dela3499 / PartitionBy.elm
Last active June 29, 2016 20:54
Implementation of partitionBy function in Elm.
import Html exposing ( text, div, span )
import Html.Attributes exposing ( .. )
import Maybe exposing ( withDefault )
import String
import Array exposing ( Array )
main =
partitionBy String.length ["aa", "a", "b", "b", "cc", "cc", "a", "ab", "bb"]
|> toString
|> text
import Graphics.Element exposing (show)
import Touch
import Signal
main = Signal.map show Touch.touches
@dela3499
dela3499 / Swipe.elm
Created August 31, 2015 18:32
Implementation of swipe gestures in Elm
import Graphics.Element exposing (show, Element)
import Touch exposing (Touch)
import Signal
import Set
type alias Swipe = Touch
touches': Signal (List Touch, List Touch)
@dela3499
dela3499 / SwipeDirection.elm
Last active August 31, 2015 21:05
Turn raw swipe information into a swipe direction. http://share-elm.com/gists/1b3187cb284e034b843f
import Graphics.Element exposing (show, Element)
import Touch exposing (Touch)
import Signal
import Set
import Maybe exposing (andThen, withDefault)
import Graphics.Collage exposing (..)
import Color exposing (..)
import Window
--import Html exposing (fromElement, Html, div, Attribute, node)
--import Html.Attributes exposing (name, content)