Skip to content

Instantly share code, notes, and snippets.

View modernserf's full-sized avatar

Justin Falcone modernserf

View GitHub Profile
@modernserf
modernserf / characters.md
Last active February 13, 2020 14:18
The Shadow Over Chelsea

The Shadow Over Chelsea

The year is 1979. A deep malaise stalks Jimmy Carter's America. In New York, the police have printed fliers warning tourists to stay off the streets after 6PM. Vigilantes keep the peace on the subway. Sid Vicious died in his hotel room last week. What a time to be alive.

New York was a breeding ground for the mystical and occult in the 1970s, and at the center of it was a magic shop called The Hidden Mirror. This shop, run by on-again, off-again lovers Harry Abel and E Krasinski, was the crossover point for astrologers, neopagans, Pythagorans, and all the other occult groups springing up in the Age of Aquarius.

On the evening February 15, 1979, 12 friends, lovers and acquaintances gathered in the home of Harry Abel and E Krasinski at 35 W 19th st.

Characters

:- discontiguous gender/2.
:- discontiguous balls/2.
:- discontiguous age/2.
:- discontiguous gender_pair/2.
:- discontiguous position/2.
% positions: [sled] -> wheel -> team -> swing -> lead
% TODO: what is the significance of the wind?
% hari
@modernserf
modernserf / build.module.js
Last active September 10, 2019 18:34
How do I get the styled components plugin to work here?
// This code should have been transformed, right??
import styled from 'styled-components';
const Foo = styled.div`
color: pink;
`;
export { Foo };
@modernserf
modernserf / Refs.md
Created August 23, 2019 21:15
Code is a User Interface references

Zebu https://github.com/modernserf/zebu

Constraints - Crista Lopes tagide.com/blog/research/constraints

Little Languages - Jon Bentley staff.um.edu.mt/afra1/seminar/little-languages.pdf

Purpose-Built Languages - Mike Shapiro

@modernserf
modernserf / anon-imperative.jsx
Last active May 25, 2019 14:04
Two approaches to handling imperative code in react
function useTransition (isActive, onEnter = noop, onExit = noop) {
const ref = useRef()
useEffect(() => {
if (!ref.current) return
if (isActive) onEnter(ref.current) else onExit(ref.current)
}, [isActive])
return ref
}
// -----
@modernserf
modernserf / context.md
Last active March 24, 2019 17:46
The React Context API in an alternate universe

The React Context API in an alternate universe

Overview

Context is "just" a prop with special behavior, like children or key. It implicitly propagates from elements to their children, unless it is explicitly overridden.

Context can be provided as a prop (to elements) or via the children object's withContext method. Context can be consumed as a prop (to components) or by using a function in children.

This component:

@modernserf
modernserf / 1.readme.md
Last active March 5, 2021 18:44
Tagged Template Binding Literals

(Tagged) Template Binding Literals

This proposal defines new syntax for destructuring binding with tagged template literals.

Status

Not submitted.

Introduction

@modernserf
modernserf / resumable-errors.js
Created January 11, 2019 02:05
Common Lisp-style resumable errors with generators
function * example (resource) {
resource.open()
yield _finally(function * () {
resource.close()
})
yield _catch(function * (error) {
if (error.message === 'foo') {
return resume('bar')
}
const isolate = (scope) =>
new Proxy(scope, {
has: () => true,
get: (target, key) => {
if (key === Symbol.unscopables) {
return undefined
}
if (key in target) {
return target[key]
}
@modernserf
modernserf / immutable-record.js
Last active December 11, 2018 17:55
Notes for "The Tyranny of Triple-Equals"
let lookupTable = Immutable.Map({})
export function record (fields) {
let key = Immutable.Map(fields)
let storedValue = lookupTable.get(key)
if (storedValue) { return storedValue }
let newValue = Object.freeze({ ...fields })
lookupTable = lookupTable.set(key, newValue)
return newValue
}