Skip to content

Instantly share code, notes, and snippets.

View TanjimReza's full-sized avatar
🎯
Focusing

Tanjim Reza TanjimReza

🎯
Focusing
View GitHub Profile
import signal
import sys
from subprocess import Popen
from django.core.management.commands.runserver import \
Command as RunserverCommand
print(f"{'-'*30}\n Custom Startup Command by Tanjim \n{'-'*30}\n")
import random
all_choices = ["rock", "paper", "scissors"]
n = int(input("Rounds:"))
def playRockPaperScissor(rounds):
your_points = 0
pc_points = 0
for i in range(rounds):
@TanjimReza
TanjimReza / Set_A.py
Created August 31, 2023 16:03
Lab Final Tracing | CSE111-38 | Summer23
# Set - A
class A:
temp = 2
def __init__(self):
self.sum = -1
self.y = 0
self.y = A.temp * 2
self.sum = A.temp + 2
A.temp -= 2
@TanjimReza
TanjimReza / VPS_Config.md
Created August 2, 2023 17:56
VPS Configuration with Gunicorn + Nginx

Setting up a Python[Django/Flask] on VPS

Personal Deployment Guide - Tanjim Reza - 02-08-2023

  • Must Create Project Dir in /home/projectname

  • Project Root -> /home/projectname/htdocs/subdomain.domain.com

  • Nginx | VHost | /etc/nginx/sites-available/projectname

server {
    listen 80;
    listen [::]:80;
import os
input_folder = r"C:\Users\Tanjim\Desktop\main\main"
# Find all sub folders
for subfolder in os.listdir(input_folder):
print(subfolder)
# Find all images in the subfolder
images = os.listdir(os.path.join(input_folder, subfolder))
print(images)
@TanjimReza
TanjimReza / rename_dir_images.py
Created July 21, 2023 18:17
Rename all the images of subdirectory images according to subdirectory name and save it in output folder with 30random shuffle
# Get All Folders and SubFolders, Get all the images in the folder and rename them according to the folder name
import os
import random
import time
start_time = time.time()
SELECT_LIMIT = 30
current_dir = os.getcwd()
#!!! INCOMPLETE
class Library:
Total_book = 1000
borrow_data = {}
def __init__(self,n,id):
self.student_name = n
#Task10
class Student:
def __init__(self,name,ID):
self.name = name
self.ID = ID
def Details(self):
return "Name: "+self.name+"\n"+"ID: "+self.ID+"\n"
#Write your code here
class CSEStudent(Student):
def __init__(self,name,ID,session):
class Netflix:
no_of_shows = 0
shows = []
def __init__(self, name, genre, episodes=10):
self.name = name
self.genre = genre
self.episodes = episodes
Netflix.no_of_shows += 1
Netflix.shows.append(self.name)
#task 18
class User:
def __init__(self,name,destination,typ="Single"):
self.name=name
self.destination=destination
self.typ=typ
def status(self):
print(f'Status: {self.name} is looking for a shared ride!')
class Uber: