This file contains 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
/** | |
* These types were taken from the JSON encoders for the Elm 0.19.1 compiler on 2021/11/16 | |
* | |
* Here are those resources: | |
* - https://github.com/elm/compiler/blob/770071accf791e8171440709effe71e78a9ab37c/builder/src/Reporting/Exit/Help.hs | |
* - https://github.com/elm/compiler/blob/770071accf791e8171440709effe71e78a9ab37c/compiler/src/Reporting/Doc.hs | |
* - https://github.com/elm/compiler/blob/770071accf791e8171440709effe71e78a9ab37c/compiler/src/Reporting/Error.hs | |
*/ | |
declare const process: any |
This file contains 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
-- src/Api.elm | |
module Api exposing (Data(..), expectJson) | |
import Http | |
import Json.Decode as Json | |
type Data value | |
= NotAsked | |
| Loading |
This file contains 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 Components.Carousel exposing | |
( Carousel | |
, create | |
, next | |
, previous | |
, select | |
, view | |
) | |
import Array |
This file contains 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 Page exposing | |
( Page, Document, Bundle | |
, upgrade | |
, static, sandbox, element, component | |
) | |
{-| | |
@docs Page, Document, Bundle |
This file contains 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 Page exposing | |
( Page, Document, Bundle | |
, upgrade | |
, static, sandbox, element, component | |
) | |
{-| | |
@docs Page, Document, Bundle |
This file contains 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 Application exposing (..., init, update, bundle, Initializer, Updater, Bundler) | |
type Initializer = | |
Initializer (Context -> ( Model, Cmd Msg, Cmd App.Msg)) | |
type Updater = | |
Updater (Context -> ( Model, Cmd Msg, Cmd App.Msg)) | |
type Bundler = |
This file contains 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
(ns questionnaire) | |
(def questions | |
{ "What's your name?" :name | |
"What's your favorite color?" :color | |
}) | |
(defn bold [text] (str "\033[1m" text "\033[0m")) | |
(defn prompt [question] (do (print (str (bold question) " ")) (flush) (read-line))) |
This file contains 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
(ns user) | |
(defn askForNumber | |
"Asks for a number within a range, returning nil if input is not a number." | |
[ low high ] | |
(do | |
(print (str "Pick a number from " low " to " high ": ")) | |
(flush) | |
(let [ num (read-string (read-line))] | |
(if (number? num) num nil)) |
This file contains 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
// Examples | |
// To make this functions goal more clear, here are some example inputs with their expected outputs. | |
/* | |
const examples = [ | |
{ | |
input: { name: 'Ryan' }, | |
output: { name: 'Ryan' } | |
}, | |
{ | |
input: { name: { first: 'Ryan', last: 'Haskell-Glatz' } }, |
This file contains 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
const equals = (obj1, obj2) => { | |
const sortKeys = (obj) => | |
(obj && typeof obj === 'object') | |
? Object.keys(obj) | |
.sort((a, b) => a < b) | |
.reduce((newObj, key) => { | |
newObj[key] = sortKeys(obj[key]) | |
return newObj | |
}, {}) | |
: obj |
NewerOlder