This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _ = require 'lodash' | |
| main = document.createElement "div" | |
| main.id = "main" | |
| document.body.appendChild main | |
| data = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _ = require 'lodash' | |
| # app = Elm.Main.fullscreen() | |
| main = document.createElement "div" | |
| canvas = document.createElement "canvas" | |
| main.appendChild canvas | |
| ctx = canvas.getContext "2d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-| -} | |
| onDoubleClick : (Point -> msg) -> Attribute msg | |
| onDoubleClick message = | |
| on "dblclick" <| | |
| Json.map | |
| (positionInCanvas >> message) | |
| positionDecoder | |
| positionInCanvas : ( Point, Point ) -> Point |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Canvas.Point | |
| exposing | |
| ( Point | |
| , fromFloats | |
| , fromInts | |
| , toFloats | |
| , toInts | |
| ) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Html = require("html"); | |
| var Attributes = Html.Attributes; | |
| var Events = Html.Events; | |
| Html.App({ | |
| init: { | |
| model: { | |
| field: "Dank memes!" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| allAlphanumeric : String -> Bool | |
| allAlphanumeric str = | |
| List.map isAlphanumeric (String.toList str) | |
| |> List.foldr (||) False | |
| isAlphanumeric : Char -> Bool | |
| isAlphanumeric char = | |
| String.contains (String.fromChar char) alphanumeric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try : RegisterModel -> ( RegisterModel, Cmd Msg ) | |
| try model = | |
| if List.isEmpty model.problems then | |
| log "ayy register!" ( model, register model ) | |
| else | |
| { model | |
| | showProblems = True | |
| } | |
| ! [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // What you do in redux to my knowledge | |
| switch (action) { | |
| case "update username field" : | |
| return { | |
| username: payload, | |
| ...state | |
| } | |
| case "submit" : | |
| submit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cp = require("child_process"); | |
| var util = require("gulp-util"); | |
| var paths = { | |
| mainElm: "./source/Main.elm", | |
| dev: "./development" | |
| }; | |
| gulp.task("elm-make", function () { | |
| var cmd; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetRegistration key value -> | |
| { model | |
| | adminModel = | |
| model.adminModel.userToRegister | |
| |> updateUser key value | |
| |> insertUser model.adminModel | |
| } | |
| ! [] | |
| updateUser : String -> String -> User -> User |