Skip to content

Instantly share code, notes, and snippets.

@dz4k
dz4k / taml.ebnf
Last active September 30, 2020 20:46
TAML EBNF
(*
# Tokens
* newline: one or more CR or CRLF
* tab: one or more tab characters not following a newline
* string: one or more characters none of which are tabs or newlines
The following tokens relate to indentation tracking:
@dz4k
dz4k / Draggable._hs
Last active December 25, 2023 10:47
Draggable window in _hyperscript
-- Usage: _="install Draggable(dragHandle: .titlebar in me)"
behavior Draggable(dragHandle)
init
if no dragHandle set the dragHandle to me
end
on pointerdown(clientX, clientY) from dragHandle
halt the event
trigger draggable:start -- hooks, e.g. for adding a drop shadow while dragging
measure my x, y
@dz4k
dz4k / shadow-dom._hs
Created June 13, 2021 14:48
Hyperscript DOM Isolation
behavior DomIsolation
init
attachShadow({ mode: "open" }) on me
put my children into it
end
end
@dz4k
dz4k / discord_bot._hs
Last active August 24, 2021 10:35
Discord bot in _hyperscript
require discord.js as Discord
init immediately
make a Discord.Client from {
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES]
}
set module discord to it
login(process.env.TOKEN) to discord
end

Intentionally Unscalable

Deniz Akşimşek, 2021-11-22

_hyperscript is intentionally unscalable. We make decisions that would be obviously inadvisable to anyone looking to make scalable software, and dismiss features like reactivity that seem to have proven themselves in this regard. To understand why, I examine and critique the concept of "scalable".

@dz4k
dz4k / classes.css
Created September 22, 2022 11:46
List of classes and custom elements in missing.css
/* components */
.box
.titlebar
.breadcrumbs
.chip
.navbar
.permalink-anchor
.sidebar
.sub-title
sub-title
@dz4k
dz4k / _config.ts
Created October 1, 2022 10:25
why does this not work
import lume from "https://deno.land/x/lume/mod.ts"
import { WebC } from "npm:@11ty/webc"
console.log(new WebC)
export default lume()