Skip to content

Instantly share code, notes, and snippets.

@yang-wei
yang-wei / decode.md
Last active April 2, 2024 20:18
Elm Json.Decode tutorial and cheatsheet

When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.

I like to follow working example code so this is how the boilerplate will look like:

import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))

import Http
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@justinwoo
justinwoo / using-rxjs-instead-of-flux-with-react.md
Last active October 21, 2023 10:16
Using RxJS instead of Flux with React to organize data flow

Reposted from Qiita

For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.

Why I'm tired of using and teaching flux

There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.

If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow:

@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@patrickleet
patrickleet / configureYelp.html
Last active August 11, 2017 16:05
Meteor OAuth1Binding REST calls using oauth1 package (Yelp example)
<template name='configureYelp'>
<div class="container">
<div class="section">
<h1>Yelp API Access Configuration</h1>
<p class="lead">Do not change if you don't know what you are doing.</p>
<p>{{currentConfig}}</p>
{{> quickForm schema=configureYelp doc=this id='configureYelp' type='method' meteormethod='configureYelp' buttonClasses="btn btn-primary" buttonContent="Configure Yelp"}}
</div>
</div>
</template>