Skip to content

Instantly share code, notes, and snippets.

@matthewp
matthewp / notes.ts
Created June 18, 2021 12:24
lucy typescript notes
import { EventObject, Guard, InvokeCreator, StateMachine } from 'xstate'
type EventNames = 'GO_BACK' | 'GO_FORWARD' | 'GO_SIDEWAYS';
type KnownContextKeys = 'user';
type LucyKnownContext<Keys extends string> = Record<Keys, any>
function createMachine<TContext extends LucyKnownContext<KnownContextKeys>, TEvent extends { type: EventNames } = any>() {
return {} as any

This is some docs

Something I want to test below...

const foo = 'bar';
@matthewp
matthewp / .gitignore
Last active June 7, 2021 21:35
Demo TypeScript/Lucy project
node_modules/
@matthewp
matthewp / app.js
Created February 18, 2021 13:39
audio-context-timers snowpack example
import * as aud from 'audio-context-timers';
console.log(aud);
@matthewp
matthewp / Makefile
Created July 7, 2020 13:21
Lambda makefile
main.zip: main.js package.json package-lock.json src lib node_modules
zip -r $@ $^
clean:
@rm -f main.zip deploy.json
.PHONY: clean
deploy.json: main.zip
aws lambda update-function-code --function-name my-function-name --zip-file fileb://./$^ > $@
@matthewp
matthewp / demo.js
Created June 23, 2020 13:58
Import strangeness
let error1, error2;
try {
await import('/mod.js');
} catch(err) {
error1 = err;
}
try {
await import('/mod.js');
@matthewp
matthewp / extensible-web-manifesto.md
Last active January 15, 2020 21:21
A Proposed Addendum to the Extensible Web Manifesto
@matthewp
matthewp / .gitignore
Last active January 11, 2020 15:23
Zig Robot
zig-cache
@matthewp
matthewp / release-notes.md
Last active January 7, 2020 18:48
QOSDK Release Notes - ES Export

This release adds support for a JavaScript module entry point. If you are using a bundler like webpack this will be used automatically and you do not need to make any changes.

Usage

Usage is described in the readme. In short you can import any of the primary classes like so:

import {
	Menu,
	Cart,
@matthewp
matthewp / .gitignore
Created December 31, 2019 21:06
Minimal example
out.mjs
node_modules/