Skip to content

Instantly share code, notes, and snippets.

View manzt's full-sized avatar
🥚
🐣🐥

Trevor Manz manzt

🥚
🐣🐥
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manzt
manzt / my-ts-monorepo.md
Last active March 15, 2025 22:36
A minimal setup for TypeScript monorepo libraries

My Minimal TypeScript Monorepo Setup for ESM Libraries

After a deep dive looking up best practices for TypeScript monorepos recently, I couldn't find anything that suited my needs:

  1. Publish individual (typed) packages to NPM with minimal config.
  2. Supports fast unit testing that spans the entire project (e.g., via Vitest)
  3. Ability to have an interactive playground to experiment with the API in a real-time (e.g., via Vite)

Most solutions point to TypeScript project references,

@manzt
manzt / README.md
Created August 31, 2023 21:54
minimal higlass + vite

minimal higlass vite

pnpm install
pnpm dev
import anywidget
import traitlets
class ExampleWidget(anywidget.AnyWidget):
_esm = """
export function render({ model, el }) {
el.classList.add("custom-widget");
function valueChanged() {
el.textContent = model.get("value");
}
@manzt
manzt / index.html
Last active May 18, 2023 16:27
An animated observable line plot
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Interactive Observable Plot</title>
<script type="module" src="/main.js"></script>
</head>
<style>
:root {
font-family: sans-serif;
@manzt
manzt / ts-info.ts
Last active May 3, 2023 20:33
some (incomplete) types for HiGlass tilesets
type ChromSizes = [name: string, length: number][]
type ChromName = unknown;
type TilesetInfo = {};
type Bam = {
min_pos: [number];
max_pos: [number];
max_zoom: number;
@manzt
manzt / rename-jsx.mjs
Last active May 1, 2023 16:23
Utility script to rename React files with .js to .jsx
// @ts-check
import * as fsp from "node:fs/promises";
import * as util from "node:util";
import glob from "glob";
let matchingReactString = "from 'react'";
let BLUE = "\u001b[34m";
let YELLOW = "\u001b[33m";
let RESET = "\u001b[0m";
@manzt
manzt / anywidget-arrow.ipynb
Last active December 4, 2024 22:28
anywidget-arrow.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manzt
manzt / live-mpl.ipynb
Created February 28, 2023 19:24
live matplotlib views with jupyter-scatter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manzt
manzt / example.ipynb
Created February 28, 2023 17:20
jupyter-scatter derived state
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.