Skip to content

Instantly share code, notes, and snippets.

View eh-dub's full-sized avatar

Ariel Weingarten eh-dub

View GitHub Profile
@eh-dub
eh-dub / countryCodes.ts
Created April 6, 2020 20:24
Two-letter country code string union type (codes taken from https://theodora.com/country_digraphs.html)
export type CountryCode =
| "AF"
| "AX"
| "AL"
| "DZ"
| "AS"
| "AD"
| "AO"
| "AI"
| "AQ"
@eh-dub
eh-dub / index.d.ts
Last active June 10, 2021 16:45
Sapper + Svelte + Typescript
// in $PROJECT_ROOT/typings/@sapper
declare module '@sapper/app' {
// from sapper/runtime/src/app/types.ts
// sapper doesn't export its types yet
interface Redirect {
statusCode: number
location: string
}
// end
@eh-dub
eh-dub / blogpost.md
Last active August 6, 2017 21:00
Managing Complexity in Elm

Managing Complexity in Elm

I have been writing Elm code for a recent project. It is great at the start, but then the model gets larger and complexity creeps in. Files grow over 100 lines in length. That's a sign of trouble.

The official Elm Guide offers a few words about reuse and it is worth giving it a read. However, it is anchored in reuse of view code and does not offer any information about decomposing the Update and Model monoliths.

How to best dissolve my ever expanding Update.elm and Model.elm?

Update and Model

@eh-dub
eh-dub / Update.elm
Created August 1, 2017 04:46
Problematic Elm Decomposition
module Update exposing (update)