Skip to content

Instantly share code, notes, and snippets.

View zayniddindev's full-sized avatar
🌻

Zayniddin Otabaev zayniddindev

🌻
View GitHub Profile
@zayniddindev
zayniddindev / getLocalizedContent.ts
Last active July 26, 2025 08:14
Mapper for language-specific content to a specific language
enum Language {
UZ = 'UZ',
EN = 'EN',
RU = 'RU',
}
interface IContent {
uz: string;
ru: string;
en: string;
@zayniddindev
zayniddindev / app-runner.ts
Last active May 12, 2025 06:00
Runner for Node.js backend and React frontend
import { Context } from "./context";
import * as chalk from "chalk";
import * as Table from "cli-table3";
import * as ngrok from "@ngrok/ngrok";
import * as webpack from "webpack";
import * as WebpackDevServer from "webpack-dev-server";
import * as nodemon from "nodemon";
export const infoChalk = chalk.blue.bold;
export const warnChalk = chalk.bgYellow.bold;
@zayniddindev
zayniddindev / extract.ts
Created December 2, 2024 17:29
Recursively extracts all possible dot-separated key paths from a nested object
/**
* Recursively extracts all possible dot-separated key paths from a nested object.
* If the object has nested objects, it concatenates parent keys with nested keys using dot notation.
*
* @template T - The object type to extract keys from.
*
* @example
* type Obj = {
* campaigns: {
* list: {};
@zayniddindev
zayniddindev / google-otp.ts
Created April 1, 2024 03:10
Playwright script to get OTP from Gmail
/**
*
* @param {{page: import("playwright").Page, email: string, password: string}}
*/
async function getOtpFromGmail({ page, email, password }) {
await page.goto("https://mail.google.com");
const emailInput = await page.waitForSelector("#identifierId");
await emailInput.fill(email);
@zayniddindev
zayniddindev / docker-compose.yaml
Created April 1, 2024 02:31
Docker compose to run Postgres(PostGIS included) with Adminer
version: '3.7'
name: database
services:
postgres:
image: postgis/postgis:latest
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: 1234
ports:
- 5432:5432
@zayniddindev
zayniddindev / docker-compose.yaml
Created April 1, 2024 02:29
Docker compose to run MySQL with Adminer
version: '3.7'
services:
mysql:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: 1234
ports:
- 3306:3306
volumes: