Skip to content

Instantly share code, notes, and snippets.

View SandyGifford's full-sized avatar
🦿

Sandy Gifford SandyGifford

🦿
  • Clickety
  • New York, NY
View GitHub Profile
@SandyGifford
SandyGifford / vector.utils.ts
Created June 7, 2023 13:17
Intersections between two circles
export type Vec2 = { x: number; y: number };
export const vecAdd = (...vs: readonly Readonly<Vec2>[]): Vec2 =>
vs.reduce(
(acc, v) => ({
x: acc.x + v.x,
y: acc.y + v.y,
}),
{ x: 0, y: 0 }
);
@SandyGifford
SandyGifford / linearTicketList.js
Last active July 12, 2022 14:02
Adds a button to Linear which, when clicked, copies a markdown list of all checked tickets to the clipboard
(() => {
const BUTTON_CLASS_NAME = "getTicketListButton";
document.querySelectorAll(`.${BUTTON_CLASS_NAME}`).forEach((btn) => btn.parentElement?.removeChild(btn));
const btn = document.createElement("button");
document.body.append(btn);
btn.className = BUTTON_CLASS_NAME;
@SandyGifford
SandyGifford / MUI_TS_snippet.json
Last active February 14, 2022 16:34
VSC Snippet for Typescript/Material UI components
{
"MUI Component": {
"prefix": "muicomp",
"description": "Material UI component template",
"body": [
"import { VFC } from \"react\";",
"import { makeStyles } from \"@material-ui/core\";",
"import { ClassNameMap } from \"@material-ui/core/styles/withStyles\";",
"import clsx from \"clsx\";",
"",
@SandyGifford
SandyGifford / markImage.js
Last active May 15, 2020 14:09
Paste this into the console when viewing any image in chrome. You'll be prompted for a "max" value. Click anywhere on the image to place an "X". Click on any X to remove it. State is stored in local storage so you can rerun the script on any image and pick up from where you left off. Click the number in the top right to change the max.
/**********************************/
/* */
/* DO NOT PUT ANY CODE YOU DO NOT */
/* UNDERSTAND INTO YOUR BROWSER'S */
/* CONSOLE. */
/* */
/**********************************/
(() => {
let total;
@SandyGifford
SandyGifford / Twister.js
Last active April 3, 2020 00:31
paste this into your browser's console to start a game - click, or press any key to end the game
/**********************************/
/* */
/* DO NOT PUT ANY CODE YOU DO NOT */
/* UNDERSTAND INTO YOUR BROWSER'S */
/* CONSOLE. */
/* */
/**********************************/
(() => {
const INITIAL_DELAY = 5000;

Keybase proof

I hereby claim:

  • I am sandygifford on github.
  • I am sandygifford (https://keybase.io/sandygifford) on keybase.
  • I have a public key ASDfMzeFJcN4we--DBAqItDgFu15ECCFOkF7eCtkXGp3lgo

To claim this, I am signing this object: