Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active November 17, 2024 10:01
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active August 8, 2024 13:26
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/ \
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") &&
@mberneti
mberneti / retryDynamicImport.ts
Last active November 11, 2024 05:32
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