Skip to content

Instantly share code, notes, and snippets.

@bitterjug
bitterjug / RequestsInElm.markdown
Last active April 20, 2019 20:15
Elm Cambridge Meetup on Http Requests in Elm

Http in Elm

  1. Elm looks after your system state, or model.
  2. Set it up with init
  3. All input is via messages (Msg): data values you define
  4. All side-effects are via commands (Cmd) data values defined by Elm
  5. The only 'callbacks' are update and view
  6. On input (from, e.g., user or servers) Elm calls update passing a Msg, and the current model
@bitterjug
bitterjug / keybase.md
Created August 26, 2018 09:29
keybase.md

Keybase proof

I hereby claim:

  • I am bitterjug on github.
  • I am bitterjug (https://keybase.io/bitterjug) on keybase.
  • I have a public key ASD0Pg6TeIdISMoZL2PTwTKwe7MKRVj8kMASCTbkKWKexgo

To claim this, I am signing this object:

@bitterjug
bitterjug / prepare-commit-msg
Created December 7, 2017 12:24
Add the current branch name to the start of each commit message if not already there
#!/usr/bin/env bash
# Add the branch name as the first line of the commit message.
# .git/hooks/prepare-commit-msg
NAME=$(git rev-parse --abbrev-ref HEAD)
[[ $(head -1 $1) =~ ^${NAME} ]] || echo -e "$NAME $(cat $1)" > "$1"
@bitterjug
bitterjug / ElmEurope2017.md
Last active August 17, 2017 07:24
Report from Elm Europe 2017
@bitterjug
bitterjug / WriteSomeElm.md
Last active March 15, 2018 10:32
Notes for Cambridge Elm Meetup 24 July 2017

Cambridge Elm Meetup: Write some Elm

Here's the plan:

Write a spell-checker app using the Montana Flynn Spellcheck API hosted on Mashape.com. (You need a Mashape API key to use this API. I signed up with my github account.) Your app may be arbitrarily complex, but a simple one might comprise: a text area to enter text, a "check spelling" button and a place to show the suggestion from the api.

If you don't have Elm installed, use the awesome Ellie editor online.

Depending on your familiarity with Elm, you might like some guidance. This is what I did: