Skip to content

Instantly share code, notes, and snippets.

Scroll to Highlight feature for freelance devs

how to use

JSX

import { useScrollHighlight } from '@/hooks/useScrollHighlight"; add the '' wrapper to the layout around the top level parent container of the project's main scrollable content

export default function RootLayout({
@Atlessc
Atlessc / pull-iphone-data.js
Last active January 25, 2025 04:36
pull-iphone-data.js
const { execSync } = require("child_process");
var XLSX = require("xlsx");
const startTime = new Date();
// Function to calculate and format elapsed time
const getElapsedTime = () => {
const elapsed = new Date() - startTime;
const minutes = Math.floor(elapsed / 60000).toString().padStart(2, "0");
const seconds = Math.floor((elapsed % 60000) / 1000).toString().padStart(2, "0");
@Atlessc
Atlessc / map-project-structure.js
Created August 24, 2024 20:12
Map your web app project structure. it'll exclude the .env, .git, and the node_module folder.
import fs from 'fs';
import path from 'path';
function mapFiles(dir, excludedPaths = [], prefix = '', isLast = true) {
const items = fs.readdirSync(dir);
items.forEach((item, index) => {
const fullPath = path.join(dir, item);
const isExcludedPath = excludedPaths.includes(fullPath);
const isDirectory = fs.statSync(fullPath).isDirectory();