Skip to content

Instantly share code, notes, and snippets.

@hinsxd
hinsxd / aoc2023day9.js
Created December 9, 2023 05:30
2023 day 9
/**
*
* @param {string} input
* @returns {number}
*/
export default function (input) {
const lines = input.split("\n");
let p1 = 0;
let p2 = 0;
@hinsxd
hinsxd / usePagination.ts
Last active September 6, 2023 14:51
Pagination hook
import { useMemo } from "react";
type PaginationProps = {
onPageChange: (page: number) => void;
totalCount: number;
siblingCount?: number;
currentPage: number;