Skip to content

Instantly share code, notes, and snippets.

View hellojahid3's full-sized avatar

Md. Jahid Hasan hellojahid3

View GitHub Profile
@hellojahid3
hellojahid3 / s3-bucket-downloader.py
Last active June 23, 2025 09:16
Python application provides a feature-rich graphical user interface for downloading files from S3-compatible storage services (AWS S3, DigitalOcean Spaces, etc.). It uses boto3 for S3 operations and Tkinter for the GUI.
#!/usr/bin/env python3
import boto3
import os
import logging
import sys
import threading
import tkinter as tk
from tkinter import ttk, filedialog, messagebox
from typing import Optional
@hellojahid3
hellojahid3 / mysql-docker-compose.yml
Last active May 12, 2025 18:06
MySQL Database with Replica Set and Persistent Storage - Portainer Stack Template
# Set the environment variables from Portainer
#
# MYSQL_ROOT_PASSWORD=root_secure_password
# MYSQL_USER=custom_user
# MYSQL_PASSWORD=secure_password
# MYSQL_DATABASE=database_name
# MYSQL_REPLICATION_USER=replicator
# MYSQL_REPLICATION_PASSWORD=replicator_password
version: "3.9"
@hellojahid3
hellojahid3 / docker-compose.yml
Created October 29, 2024 18:19
PostgreSQL Database with Replica Set and Persistent Storage - Portainer Stack Template
# Set the environment variables from Portainer
#
# POSTGRES_USER=psql_demo
# POSTGRES_PASSWORD=some_secure_password
# POSTGRES_DB=psql_demo_db
# POSTGRES_REPLICATION_USER=replicator
# POSTGRES_REPLICATION_PASSWORD=replicator_password
version: "3.9"
@hellojahid3
hellojahid3 / docker-compose.yml
Last active October 29, 2024 18:20
Redis Database Server with Replica Set and Persistent Storage - Portainer Stack Template
# Set the environment variables from Portainer
#
# REDIS_PASSWORD=some_secure_password
version: "3.9"
services:
redis:
container_name: redis
image: redis/redis-stack:latest
@hellojahid3
hellojahid3 / logarithmic-pagination.js
Created August 23, 2023 18:21
Utility function to create logarithmic pagination
/**
* Utility function to create logarithmic pagination
* @param {number} currentPage Current page number
* @param {number} totalPages Total number of pages
* @param {string} gapCharacter The gap character ex. ...
* @returns current page number, previous page number, next page number, array of pages (includes the gap character)
*/
function getPagination(currentPage = 1, totalPages = 1, gapCharacter = "...") {
let prevPage = currentPage <= 1 ? null : currentPage - 1
let nextPage = currentPage !== totalPages ? currentPage + 1 : null
@hellojahid3
hellojahid3 / getCssModuleClasses.ts
Created August 17, 2023 20:21
Utility function will convert the css module classes to DOM friendly classes
// Css module object
interface StyleObject {
readonly [key: string]: string
}
/**
* Represents a string of all classes from css modules.
* @param {object} styleObject - Full object of css module.
* @returns {string} The string representation of multiple css modules
*/