Skip to content

Instantly share code, notes, and snippets.

@richard-flosi
richard-flosi / star-wars-planets.html
Last active January 17, 2024 07:58
Web Component using Custom Element, Shadow DOM, fetch, async/await, and the Star Wars API
<html>
<head>
<script>
customElements.define("star-wars-planets", class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
}
static get observedAttributes() { return ["loading", "planets"]; }
@ivenmarquardt
ivenmarquardt / todo-app.js
Last active May 14, 2022 03:36
Functional Reactive Programming (FRP) implemented with a couple rules, types and combinators
// Based on this blog post: https://medium.com/@iquardt/taming-the-dom-50c8f1a6e892
/* RULES
* Only the program may manipulate the output display, never the user
* User input is presented in the form of events
* GUI elements generate events only in response to user input, never in response to program output
*/
@panoply
panoply / index.html
Last active March 19, 2021 07:20
Rollup Configuration – Uses Buble, SASS and Serve. Use with Mithril.js
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Mithril Rollup.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="bundle.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>
@JAForbes
JAForbes / readme.md
Last active August 4, 2018 23:36
A simple Javascript

Warning this is purely a thought experiment and will probably go nowhere. The language semantics will likely be incongruent and non-rigourous. Proceed at your own risk.

Philosophy

Javascript always wanted to be a functional language. But for historical, political and perhaps even sensible reasons, JS's original mission was never truly fulfilled.

But what if, we take JS and start removing things. We can remove mutation, remove variables, remove classes, remove variadic signatures, remove default arguments and on and on.

What if we go back to ES1 and re-evaluate a future unperturbed by corporate circumstance.

@srdjan
srdjan / 100+ different counter apps...
Last active May 6, 2024 05:13
100+ different js counter apps...
100+ different js counter apps...
@markerikson
markerikson / jdubray-gitter-logs.md
Last active January 30, 2021 04:09
jdubray statements on Redux

Jean-Jacques Dubray
@jdubray
Feb 06 23:05
@robwormald welcome! honored to speak to you. If you like Redux, well, SAM is the correct semantics that Redux should have had. It tried to speak to Dan about it, but he never replied to me. SAM's semantics are based on TLA+ so you can't find a more robust formalism.

Stardrive Engineering
@HighOnDrive

@rsbowman
rsbowman / main.js
Last active February 10, 2016 13:14
cycle.js dynamic list of counters
import {Observable} from 'rx';
import Cycle from '@cycle/core';
import {hr, div, button, p, makeDOMDriver} from '@cycle/dom';
import isolate from '@cycle/isolate';
import combineLatestObj from 'rx-combine-latest-obj';
/* Make a list of "counters", each keeps track of its count
* and has a + and - button to modify the count. The counter_list
* component can add and remove counters dynamically.
*/
@ntilwalli
ntilwalli / ColdToHotRxJS.md
Last active January 24, 2016 18:13
Going from Cold to Hot

###A Walkthrough of Observables, Subjects, Replay and Sharing Streams in RxJS

To properly understand observables in RxJS you need to understand cold vs. hot, subscription propagation and how subscription propagation is modified by Subjects.

####Cold vs. Hot

@Avaq
Avaq / combinators.js
Last active May 1, 2024 09:38
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@robertknight
robertknight / elm-setup-notes.md
Created November 14, 2015 07:29
Elm setup notes

Elm Tutorial Notes

  1. Went to elm-lang hopepage, skimmed the initial instructions, went for the Install option so I could develop in my preferred editor (Atom).
  2. Not obvious where to go next after that, went to the Docs link at the top. Was expecting to find an 'Intro to Elm' guide. In lieu of that, picked the next most obvious thing which was walking through the Quick Start links.