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 / uicomponents.elm
Last active August 29, 2015 14:27
UI Components
import Signal exposing (Address)
import Html exposing (Html)
import Task exposing (Task)
import Time exposing (Time)
import Window
type Never = Never Never
type alias Init options state effect = options -> (state, Maybe effect)
import Graphics.Element exposing (show)
import Signal exposing (Address)
import Html exposing (Html, div, span, text, input)
import Html.Events exposing (on, targetValue)
import Html.Attributes exposing (value, style)
import Maybe
import StartApp
---------------------------
main =
@TheSeamau5
TheSeamau5 / treehelp.elm
Last active August 29, 2015 14:27
Help with trees and zippers
import Graphics.Element exposing (show)
import Signal exposing (Address)
import Html exposing (Html, div, button, text, input)
import Html.Events exposing (on, targetValue)
import Html.Attributes exposing (value)
import Maybe exposing (andThen)
--------------
-- Suppose I have text inputs.
-- The state of these text inputs is the value of the string inside
import Signal exposing (Address)
import Json.Decode as Json exposing (Decoder, list, int, float, maybe, (:=))
import Html exposing (Html, Attribute, div, ul, li, text, span, input)
import Html.Attributes exposing (style)
import Html.Events exposing (on, targetValue)
-------------------
-- MAIN -----------
-------------------
@TheSeamau5
TheSeamau5 / earthvenusdance.elm
Last active August 29, 2015 14:26
Earth Venus Dance
import Graphics.Element exposing (Element)
import Graphics.Collage exposing (Form, collage, circle, rect, move, group, filled, solid, segment, traced)
import Time exposing (Time, fps)
import Color exposing (Color)
import Window
import Signal exposing (Signal, Mailbox)
import Task exposing (Task)
------------------------------
main =
@TheSeamau5
TheSeamau5 / infiniteprimes.elm
Created July 31, 2015 19:57
Infinite list of primes
import Html exposing (Html, Attribute, ul, li, text, div)
import Html.Attributes exposing (style)
import Html.Events
import Json.Decode as Json exposing (Decoder, (:=))
import Signal exposing (Address)
import StartApp
----------------------------------
initial : State Int
initial =
import Html exposing (Html, Attribute, div, img, input)
import Html.Attributes exposing (style, src, width, height, type')
import Html.Events
import Json.Decode as Json exposing (Decoder, (:=))
import Signal exposing (Address)
import StartApp
import String
import Debug
@TheSeamau5
TheSeamau5 / imagecaptureexample.html
Last active August 29, 2015 14:25
Image Capture example
<form>
<input id = "myInput" type="file" accept="image/*" capture="camera">
<img id ="myImage" src = "#"/>
</form>
import Html exposing (..)
import String
import List
import Color exposing (Color)
--
infixl 2 =>
(=>) = (,)
--
import Graphics.Element exposing (Element)
import Graphics.Collage exposing (..)
import Color
import Signal
import Time
-- Play with this value and hot swap the code
gravity =
{ x = 1