View elm-error-json.ts
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 |
View Api.elm
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 |
View Carousel.elm
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 |
View Page.elm
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 |
View Page.elm
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 |
View New.Application.elm
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 = |
View questionnaire.clj
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))) |
View guess.clj
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)) |
View dottify.js
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' } }, |
View equals.js
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