Skip to content

Instantly share code, notes, and snippets.

@peerreynders
peerreynders / index.html
Last active January 8, 2021 18:04
A progressive disclosure component with regular-elements
<!DOCTYPE html>
<html lang="en">
<!--
"A progressive disclosure component"
https://piccalil.li/tutorial/a-progressive-disclosure-component
with regular-elements
https://github.com/WebReflection/regular-elements
instead of a web component
-->
<head>
@peerreynders
peerreynders / es2015.js
Last active October 13, 2020 02:59
Differential Serving
window._log('ECMAScript 2015 - with classes but no modules');
@peerreynders
peerreynders / children.html
Last active October 17, 2020 22:24
"Slots" in Preact
<!doctype html>
<html lang="eng">
<!--
Based on: Getting Your Head Around Vue.js Scoped Slots - Anthony Gore
https://vuejsdevelopers.com/2017/10/02/vue-js-scoped-slots/
https://codepen.io/anthonygore/pen/zExPZX
-->
<head>
<meta charset="utf-8"/>
<title>"Slots" in Preact using children prop</title>
@peerreynders
peerreynders / index.html
Last active March 21, 2021 06:52
Passing server generated data to client side code
<!doctype html>
<html lang="eng">
<!--
Originally:
https://elixirforum.com/t/passing-json-between-simple-reactjs-and-phoenix-elixir/19799/6
See also:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Embedding_data_in_HTML
-->
<head>
@peerreynders
peerreynders / index.html
Last active October 31, 2020 18:54
Quick'n dirty transformation benchmark
<!doctype html>
<html lang="eng">
<!--
-->
<head>
<meta charset="utf-8"/>
<title>Transform Benchmark</title>
<style>
p {
font: 1.25em monospace;
@peerreynders
peerreynders / permutations.html
Created January 5, 2021 01:18
itertools.permutations in vanilla JavaScript
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>itertools.permutations in vanilla JavaScript</title>
</head>
<body>
<p>Check Developer Tools Console (Chrome) or Web Developer Web Console (Firefox) </p>
@peerreynders
peerreynders / index.js
Created March 12, 2021 03:29
Marko - first steps
// file: /src/index.js
import fastify from 'fastify';
import marko from 'marko';
import pointOfView from 'point-of-view';
const app = fastify({
logger: true
});
app.register(pointOfView, {
@peerreynders
peerreynders / notes.md
Last active February 22, 2022 16:24
Experiment: Astro with Communicating Islands

Experiment: Astro with Communicating Islands

Note: There is an official example with-nanostores that lets two islands communicate via nanostores.


Caution: At this point it is unclear whether this technique interferes with the islands autonomous hydration process. On the surface this seems to work but it's not clear what potential drawbacks there may be.

The experiment was performed on a "Starter Kit" installation with a Preact renderer.

@peerreynders
peerreynders / SmartUIAntiPattern.md
Created August 2, 2022 13:27
Smart UI “Anti-Pattern”

The Smart UI “Anti-Pattern”

… That sums up the widely accepted Layered Architecture pattern for object applications. But this separation of UI, application, and domain is so often attempted and so seldom accomplished that its negation deserves a discussion in its own right.

Many software projects do take and should continue to take a much less sophisticated design approach that I call the Smart UI. But Smart UI is an alternate, mutually exclusive fork in the road, incompatible with the approach of domain-driven design. If that road is taken, most of what is in this book is not applicable. My interest is in the situations where the Smart UI does not apply, which is why I call it, with tongue in cheek, an “anti-pattern.” Discussing it here provides a useful contrast and will help clarify the circumstances that justify the more difficult path taken in the rest of the book.

❊ ❊ ❊

A project needs to deliver simple functionality, dominated by data entry and display, with few business rules. Staff is

@peerreynders
peerreynders / README.md
Last active September 14, 2022 14:19
µsignal 0.4.2 performance comparison

Sample run on Ubuntu 22.04 LTS [i7-4900MQ CPU @ 2.80GHz/32GB] Chromium 105.0.5195.102

Solid (solid.html)

Created 205760 nodes.
278 ms; sum: 9.11303444731602e+305

@preact/signals (preactive.html)