Skip to content

Instantly share code, notes, and snippets.

View Demnu's full-sized avatar
🐢

Harrison Collins Demnu

🐢
View GitHub Profile
@valtism
valtism / PerformantSplitLinePath.tsx
Created April 8, 2024 03:48
A more performant version of Visx's `<SplitLinePath>`. See https://github.com/airbnb/visx/issues/1591
import { LinePath, line } from "@visx/shape";
import { SplitLinePathProps } from "@visx/shape/lib/shapes/SplitLinePath";
import { Fragment } from "react";
type PerformantSplitLinePathRenderer = (renderProps: {
index: number;
path: string;
styles?: Omit<React.SVGProps<SVGPathElement>, "x" | "y" | "children">;
}) => React.ReactNode;
@adjeim
adjeim / CORS Cheat Sheet for Express + TypeScript.md
Last active January 23, 2025 23:42
CORS Cheat Sheet for Express + TypeScript
  1. Install cors package and its TypeScript types:
npm install cors
npm install --save-dev @types/cors
  1. Update the entry point of your Express app to allow your server to use cors middleware. Configure your CORS options with the origins you would like to allow.
import express from 'express';