Skip to content

Instantly share code, notes, and snippets.

View stackblitz-vim.js
(()=>{var Vr=Object.defineProperty;var Fr=(w,s,h)=>s in w?Vr(w,s,{enumerable:!0,configurable:!0,writable:!0,value:h}):w[s]=h;var J=(w,s,h)=>(Fr(w,typeof s!="symbol"?s+"":s,h),h);var{KeyCode:ve,Range:xe,Position:Fe,Selection:nt,SelectionDirection:it}=monaco,Ve=window.monaco.editor,Wr={Bottom:4},Ur={readOnly:65,cursorWidth:20,fontInfo:32},$r=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function jr(w){return/\w/.test(w)||w>"\x80"&&(w.toUpperCase()!=w.toLowerCase()||$r.test(w))}function We(w,s){if(!(this instanceof We))return new We(w,s);this.line=w,this.ch=s}function Jr(w,s,h){w.dispatch(s,h)}function Re(w){return function(){}}var Wt,Ut;String.prototype.normalize?(Wt=function(w){return w.normalize("NFD").toLowerCase()},Ut=function(w){return w.normalize("NFD")}):(Wt=function(w){return w.toLowerCase()},Ut=function(w){return w});var jt=function(w,s){this.pos=this.start=0,this.string=w,this.tabSize=s||8,this.lastColumnPos=this.lastColumnValue=0,this.line
View qube.js
S = `
UUU
UUU
UUU
LLLFFFRRRBBB
LLLFFFRRRBBB
LLLFFFRRRBBB
DDD
DDD
View spring.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>Spring</title>
</head>
<div id="s" style="font-size:3em">#</div>
<body>
<script>
View loadRectIntoOAMStaging.asm
rectBuffer := generalCounter
rectX := rectBuffer+0
rectY := rectBuffer+1
rectW := rectBuffer+2
rectH := rectBuffer+3
rectAttr := rectBuffer+4
rectAddr := rectBuffer+5 ; positionValidTmp
View h2.js
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
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
<!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
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
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
const {
str,
char,
digits,
letters,
sequenceOf,
anythingExcept,
anyOfString,
many,
choice,