Author: Shaswat Raj (SH20RAJ) Script URL: View on Gist Compatible with: macOS (Intel + M1/M2/M3) Purpose: Free up space, clean developer junk, and keep your Mac lightning fast ⚡
Next.js has become the go-to framework for building modern web apps. But as projects grow, it’s easy to fall into messy structures, performance issues, and technical debt.
This guide covers best practices for Next.js development — from project structure to data fetching, state management, testing, security, and deployment.
A simple 404 page in html , css ans js featuring a hacker animation theme
A Pen by Panagiotis Kotsorgios on CodePen.
Keeping your GitHub Actions secrets in sync with your local .env
files can be a repetitive and error-prone process. Manually copying variables into GitHub’s UI every time you update .env
or .env.local
isn’t scalable.
In this guide, you’ll learn how to:
- Automatically detect the current GitHub repository
- Upload all variables from
.env
and.env.local
to GitHub Actions Secrets - Use a safe and reusable Bash script with GitHub CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch'; | |
import { v4 as uuidv4 } from 'uuid'; | |
// Generate new UUIDs | |
const sessionId = uuidv4(); | |
const userMessageId = uuidv4(); | |
const modelAMessageId = uuidv4(); | |
const modelBMessageId = uuidv4(); | |
// Build payload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div class="container"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sharp = require('sharp'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const ICONS_DIR = path.join(process.cwd(), 'public', 'icons'); | |
const SOURCE_ICON = path.join(process.cwd(), 'public', 'logo.png'); | |
// Create icons directory if it doesn't exist | |
if (!fs.existsSync(ICONS_DIR)) { | |
fs.mkdirSync(ICONS_DIR, { recursive: true }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save this as traffic_simulator.py | |
import threading | |
import requests | |
# Number of concurrent requests | |
NUM_THREADS = 1000000 | |
# Function to send requests | |
def send_requests(): | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
def delete_node_modules(start_path): | |
""" | |
Deletes all 'node_modules' folders starting from the given path. | |
:param start_path: Directory path to begin the search. | |
""" | |
deleted_count = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get the 'id' from the URL parameters | |
$id = isset($_GET['id']) ? $_GET['id'] : null; | |
if ($id) { | |
// API endpoint for the first request | |
$apiUrl = "https://terabox.hnn.workers.dev/api/get-info?shorturl={$id}&pwd="; | |
// Initialize a cURL session for the first request | |
$ch = curl_init(); |
NewerOlder