Skip to content

Instantly share code, notes, and snippets.

View ntourne's full-sized avatar

Nicolas Tourne ntourne

View GitHub Profile
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@KristofferEriksson
KristofferEriksson / useTextSelection.ts
Last active July 16, 2024 10:55
A React Typescript hook that tracks user text selections & their screen positions
import { useEffect, useState } from "react";
type UseTextSelectionReturn = {
text: string;
rects: DOMRect[];
ranges: Range[];
selection: Selection | null;
};
const getRangesFromSelection = (selection: Selection): Range[] => {