Skip to content

Instantly share code, notes, and snippets.

View nelsoneldoro's full-sized avatar

Nelson Eldoro nelsoneldoro

  • Fortaleza, Ceará, Brazil
View GitHub Profile
#!/usr/bin/env bash
set -e
# Script to list stale branches (branches that haven't been updated in a specified time period)
# Default: 2 months (60 days)
help() {
echo "List stale branches that haven't been updated in a specified time period."
echo ""
echo "Usage: stale-branches [OPTIONS]"
@nelsoneldoro
nelsoneldoro / Virtualization.tsx
Created August 20, 2025 02:20
React vanilla virtualization
import { useState } from "react";
const TOTAL = 10000; // number of items
const ITEM_HEIGHT = 30; // fixed height of each item
const VIEWPORT_HEIGHT = 300; // height of the visible container
const BUFFER = 5; // extra safety buffer (before/after)
export default function VirtualizedList() {
const [scrollTop, setScrollTop] = useState(0);