Skip to content

Instantly share code, notes, and snippets.

View matt-curtis's full-sized avatar

Matt Curtis matt-curtis

View GitHub Profile

Cheat sheet: modules

Named exports, named imports, namespace imports

If we put export in front of a named entity inside a module, it becomes a named export of that module. All other entities are private to the module.

//===== lib1.mjs =====
// Named exports
@alexreardon
alexreardon / drag-and-drop-notes.md
Last active August 22, 2025 12:44
An explanation of the timing of drag and drop events

Drag and drop

This is a collection of knowledge I have built up regarding browser powered drag and drop functionality

Events

dragstart

  • timing: once as drag is starting
  • event.target: draggable Element
@scornflake
scornflake / CALayerToMetalRenderer.swift
Created October 26, 2023 03:51
Rendering a CALayer tree to a .private/.tracked MTLTexture
import SWBShared2
import Metal
import AppKit
import CoreImage
import CoreGraphics
import QuartzCore
@globalActor
public struct CALayerToMetalRendererActor {