Skip to content

Instantly share code, notes, and snippets.

View deadfoxygrandpa's full-sized avatar

Alex Neslusan deadfoxygrandpa

  • Shenzhen, China
View GitHub Profile
@deadfoxygrandpa
deadfoxygrandpa / Button.elm
Last active January 28, 2016 17:08
React Animation Example with elm-html-animation
module Button (Model, Action, init, update, view) where
import Html
import Html.Attributes
import Html.Events
import Html.Animation
import Easing
import Effects
module Main (..) where
import Automaton
import Dict
import Graphics.Element exposing (show)
main =
Automaton.step 5 factorialAutomaton |> snd |> show
import Math.Vector3 (vec3)
import Math.Vector4 (..)
import Math.Matrix4 (..)
import Graphics.WebGL (..)
-- Create a cube in which each vertex has a position and color
type Vertex =
{ color:Vec4
import WebSocket as WS
inputs = constant ""
socket = WS.connect "ws://127.0.0.1" inputs
tests = count socket
main = (\a b-> asText a `above` asText b) <~ socket ~ tests
@deadfoxygrandpa
deadfoxygrandpa / Socket.hs
Created August 26, 2014 19:47
Elm Reactor Websockets
{-# LANGUAGE OverloadedStrings #-}
module Socket where
import Control.Monad.Trans (MonadIO(liftIO))
import Control.Monad (forever)
import Control.Concurrent (threadDelay, forkIO)
import Control.Exception (catch, SomeException)
import qualified Data.ByteString.Char8 as BSC
import qualified Filesystem.Path.CurrentOS as FP
import qualified Network.WebSockets as WS
@deadfoxygrandpa
deadfoxygrandpa / Compose.elm
Last active August 29, 2015 14:00
Composing Elm Programs
import Mouse
import Signal.InputGroups as InputGroups
import Program
import Menu
-- State tracking code to see which of Program or Menu is open:
type State = {menuOpen : Bool}
module Main where
import ElmTest.Assertion as A
import ElmTest.Run as R
import ElmTest.Runner.Console (runDisplay)
import ElmTest.Test (..)
import IO.IO (..)
import IO.Runner (Request, Response)
import IO.Runner as Run