Skip to content

Instantly share code, notes, and snippets.

View SomtoUgeh's full-sized avatar
:octocat:
Zzzzzch

Somto Medua-Ugeh SomtoUgeh

:octocat:
Zzzzzch
View GitHub Profile
@SomtoUgeh
SomtoUgeh / setup.sh
Created July 6, 2020 18:11 — forked from chris-sev/setup.sh
Mac Setup
# how to run this thingy
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
@SomtoUgeh
SomtoUgeh / useUndo.ts
Created February 19, 2024 19:09 — forked from KristofferEriksson/useUndo.ts
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;