Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -euo pipefail
if [[ $# -ne 2 ]]; then
echo "Usage: $0 <kubeconfig> <cert.p12>"
exit 1
fi
KUBECONFIG_FILE="$1"
P12_FILE="$2"
@mberneti
mberneti / retryDynamicImport.ts
Last active September 13, 2025 07:53
This utility function retryDynamicImport enhances React’s lazy loading mechanism by adding retry logic with a versioned query parameter. It retries importing a component multiple times in case of failure, which can be useful for bypassing browser cache or dealing with intermittent network issues. It can be used as a drop-in replacement for React…
// Usage:
// Replace React.lazy(() => import('x'));
// with retryDynamicImport(() => import('x'));
import { ComponentType, lazy } from 'react';
const MAX_RETRY_COUNT = 15;
const RETRY_DELAY_MS = 500;
// Regex to extract the module URL from the import statement
document.addEventListener(
"input",
function (e) {
e = e || window.event;
const target = e.target || e.srcElement;
const isFarsi = /^[\u0600-\u06FF\s]+$/.test(target.value.split(" ")[0]);
const hasDirection = target.style.cssText.includes("direction");
if (
!(target.style.direction == "rtl") &&
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active June 29, 2025 23:45
Install v2ray on Bridge:(Ubuntu +18 via systemd) - Upstream (Ubuntu +18/CentOS +7 via docker)

پنل x-ui

پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور

mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
 -v $PWD/cert/:/root/cert/ \
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active December 22, 2025 10:06
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database