Skip to content

Instantly share code, notes, and snippets.

View plaxdan's full-sized avatar

Daniel Walker plaxdan

  • Newman Lake, Washington
  • 05:34 (UTC -07:00)
View GitHub Profile
@plaxdan
plaxdan / elm-types-glossary.md
Created October 7, 2021 04:26 — forked from JoelQ/elm-types-glossary.md
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.

@plaxdan
plaxdan / promisetest.js
Created May 21, 2020 19:44
Promise.all vs Promise.allSettled
const first = new Promise(resolve => {
console.log("First finished.");
resolve();
});
const secondWithError = new Promise((resolve, reject) => reject("Second failed"));
const third = new Promise(resolve => {
setTimeout((() => {
console.log("Third finished");
@plaxdan
plaxdan / java_homebrew.sh
Created August 3, 2017 21:42 — forked from kloudsamurai/java_homebrew.sh
Install Java via Homebrew (brew) on Mac OSX with unlimited strength JCE
brew update
brew cask install java
brew cask install jce-unlimited-strength-policy
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
@plaxdan
plaxdan / wtf.js
Created November 4, 2016 19:45 — forked from MichalZalecki/wtf.js
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
@plaxdan
plaxdan / Main.elm
Created June 7, 2016 16:24
Subscribe to key presses
module Main exposing (..)
import Html exposing (Html, div, text)
import Html.App as App
import Keyboard exposing (KeyCode, presses)
type Msg
= KeyPressed KeyCode
@plaxdan
plaxdan / destructuring.md
Created May 31, 2016 01:44 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))

let
  (a,b,c) = myTuple