Skip to content

Instantly share code, notes, and snippets.

@dz4k
dz4k / Draggable._hs
Last active Apr 3, 2021
Draggable window in _hyperscript
View Draggable._hs
-- 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 / taml.ebnf
Last active Sep 30, 2020
TAML EBNF
View 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: