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
| type ProperyValueTypes = string | number | undefined; | |
| const TRACKER_ENDPOINT = "https://api.mixpanel.com/track?ip=1"; // MIXPANEL | |
| const DISTINCT_ID_KEY = "t_distinct_id"; | |
| const DEVICE_ID_PREFIX = "$device:"; | |
| interface IDInfo { | |
| $user_id?: string; | |
| $device_id: string; | |
| } |
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
| -- FILLER GAME | |
| import Html exposing (Html, text, div, h3, ol, li, p) | |
| import Html.Attributes exposing (style) | |
| import Html.Events exposing (onClick) | |
| import Array exposing (Array) | |
| import Browser | |
| import Random | |
| import Task | |
| import Set exposing (Set) |
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
| -- Pixel Art Editor | |
| import Html exposing (text, Html, div, input) | |
| import Browser | |
| import Array exposing (Array) | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (onInput, onClick, onMouseOver, onMouseUp, onMouseDown) | |
| main = | |
| Browser.sandbox {init=init, update=update, view=view} | |
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
| -- TIC-TAC-TOE | |
| import Browser | |
| import Array exposing (Array) | |
| import Html exposing (text, Html, div, h2, button) | |
| import Html.Attributes exposing (style) | |
| import Html.Events exposing (onClick) | |
| main = | |
| Browser.sandbox {init=init, update=update, view=view} | |
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
| getIndexVal: List a -> Int -> a -> a | |
| getIndexVal list index defVal = | |
| if index > 0 then | |
| case List.tail list of | |
| Nothing -> | |
| defVal | |
| Just jlist -> | |
| getIndexVal jlist (index - 1) defVal | |
| else | |
| case List.head list of |
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
| function sumFunc(val){ | |
| if(!arguments[0]) return this.sum; | |
| const sum = (this.sum || 0) + val; | |
| return (val) => sumFunc.bind({sum})(val); | |
| } | |
| // This function will perform sum operation on the chain of parameters passed to it. | |
| const ans = sumFunc(1)(2)(3)(4)(5)(6)(7)(); | |
| console.log(ans) // 28 |