Skip to content

Instantly share code, notes, and snippets.

View manzt's full-sized avatar
🥚
🐣🐥

Trevor Manz manzt

🥚
🐣🐥
View GitHub Profile
@manzt
manzt / my-ts-monorepo.md
Last active May 4, 2024 06:52
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,

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manzt
manzt / hg-tile.py
Created March 26, 2024 15:09
Map higlass tilesets to multiscale zarr
import base64
import dataclasses
import httpx
import zarr
import zarr.storage
import zarr.util
def get_tile_size(info: dict) -> int:
@manzt
manzt / README.md
Created August 31, 2023 21:54
minimal higlass + vite

minimal higlass vite

pnpm install
pnpm dev
@manzt
manzt / anywidget-arrow.ipynb
Last active January 17, 2024 16:07
anywidget-arrow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manzt
manzt / README.md
Last active December 7, 2023 07:10
esbuild-plugin-inline-webworker

esbuild-plugin-inline-webworker

Usage

// ./index.ts
import workerSrc from 'inline-worker:./worker.ts';
let worker = new Worker(workerSrc);
worker.onmessage = e => console.log(e.data); // 'world'
@manzt
manzt / gapminder-2023.csv
Created November 19, 2023 23:59
Gapminder dataset 2023
We can't make this file beautiful and searchable because it's too large.
country,year,population,gdp_per_capita,life_expectancy,continent
Afghanistan,1800,3280000,683,28.21,Asia
Afghanistan,1801,3280000,683,28.2,Asia
Afghanistan,1802,3280000,683,28.19,Asia
Afghanistan,1803,3280000,683,28.18,Asia
Afghanistan,1804,3280000,683,28.17,Asia
Afghanistan,1805,3280000,683,28.16,Asia
Afghanistan,1806,3280000,683,28.15,Asia
Afghanistan,1807,3280000,683,28.14,Asia
Afghanistan,1808,3280000,683,28.13,Asia
@manzt
manzt / Counter.svelte
Last active July 21, 2023 20:55
anywidget svelte demo
<script>
import { onDestroy, onMount } from "svelte";
export let model;
export let name = "value";
let count = model.get(name);
let event = `change:${name}`
let callback = () => count = model.get(name);
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;