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
| <# | |
| .SYNOPSIS | |
| Fast existence check for files listed in a text/playlist against a folder tree. | |
| .DESCRIPTION | |
| - Indexes all files under -RootPath (default: current folder) once. | |
| - For each line in -ListPath, checks existence by: | |
| 1) Absolute path match | |
| 2) Relative path match (case-insensitive) within the root tree | |
| 3) Optional leaf-name fallback anywhere in the tree (-AllowLeafFallback) |
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 { useRouter as useNextRouter, NextRouter } from "next/router"; | |
| type PushSignature = (href: any, as?: any, options?: any, tag?: string) => Promise<boolean>; | |
| export function useLoggedRouter(): Omit<NextRouter, "push"> & { push: PushSignature } { | |
| const router = useNextRouter(); | |
| // our new push | |
| const push: PushSignature = async (href, as, options, tag) => { | |
| console.log(`%c[router.push]${tag ? ` [${tag}]` : ""}`, "color: teal; font-weight: bold;", { href, as, options }); |
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
| #!/bin/bash | |
| set -e | |
| # Variable for the backend service address. | |
| BACKEND="127.0.0.1:8000" | |
| # Echo the purpose of this script. | |
| echo "This script installs Nginx, creates a self-signed SSL certificate, and configures Nginx as a reverse proxy to forward HTTPS requests to the backend service at ${BACKEND}." | |
| echo "Updating package index and installing nginx and openssl..." |
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
| #!/bin/bash | |
| # Fetch Cloudflare IP ranges | |
| ipv4_url="https://www.cloudflare.com/ips-v4" | |
| ipv6_url="https://www.cloudflare.com/ips-v6" | |
| # Temporary files to store IP ranges | |
| ipv4_file="/tmp/cloudflare_ipv4.txt" | |
| ipv6_file="/tmp/cloudflare_ipv6.txt" |