View loadRectIntoOAMStaging.asm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rectBuffer := generalCounter | |
rectX := rectBuffer+0 | |
rectY := rectBuffer+1 | |
rectW := rectBuffer+2 | |
rectH := rectBuffer+3 | |
rectAttr := rectBuffer+4 | |
rectAddr := rectBuffer+5 ; positionValidTmp |
View h2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let c = Symbol(); | |
h = (tag, attrs = {}, children = [], node = document.createElement(tag)) => { | |
node[c] = children; | |
Object.entries(attrs).map(([k, v]) => | |
/^on/.test(k) | |
? node.addEventListener(k.slice(2), v) | |
: node.setAttribute(k, v), | |
); | |
return node; | |
}; |
View sexpr.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const whitespaceSymbol = Symbol('whitespace'); | |
const whitespace = rawWhitespace.map(() => whitespaceSymbol); | |
const param = (param) => composeParsers([param, whitespace]); | |
// const | |
const sexpr = (fn) => { | |
const [head, ...tail] = fn(); | |
const params = sequenceOf([head, ...tail.map(param)]); |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<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>Static Template</title> | |
</head> | |
<body> | |
<script> |
View bare-words.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=(fn) => { | |
try { | |
return fn(); | |
} catch (e) { | |
// if (e instanceof ReferenceError) { | |
if (/^Re/.test(e+[])) { | |
globalThis[q=e.message.split` `[0]]=q; | |
return r(fn) | |
} else { | |
throw e; |
View h.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function h(tag, attrs = {}, children = []) { | |
const node = document.createElement(tag); | |
node.__children = children; | |
Object.entries(attrs).forEach(([k, v]) => { | |
/^on/.test(k) | |
? node.addEventListener(k.slice(2), v) | |
: node.setAttribute(k, v); | |
}); | |
return node; | |
} |
View conditional-display.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
str, | |
char, | |
digits, | |
letters, | |
sequenceOf, | |
anythingExcept, | |
anyOfString, | |
many, | |
choice, |
View confetti.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Fetti</title> | |
<style> | |
div { | |
left: 50%; | |
right: 50%; |
View combineProviders.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function combineProviders(providers) { | |
return class Combined extends React.Component { | |
render() { | |
return ( | |
providers.reverse().reduce((acc, Provider) => ( | |
<Provider>{acc}</Provider> | |
), this.props.children) | |
); | |
} | |
} |
View contexthook.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// custom hook: useStore | |
const ctx = createContext(); | |
export const Store = ({ children }) => { | |
const [state, setState] = useState(initialState); | |
const mergeState = useCallback((obj) => { | |
setState(state => ({ ...state, ...obj })); | |
}, []); |
NewerOlder