Skip to content

Instantly share code, notes, and snippets.

View siumhossain's full-sized avatar
🥱
?

sium_hossain siumhossain

🥱
?
View GitHub Profile
@siumhossain
siumhossain / command.md
Created January 1, 2025 06:53
django admin panel table wise permission set for a specific user

file save in

apps_folder --> management --> commands --> file_name.py
  • For a single model:
python manage.py create_multi_table_admin username [email protected] password --models public.LiveVideo
from django.db import models
from django.core.validators import MinValueValidator
from decimal import Decimal
from django.utils import timezone
from django.db.models import Sum
class PaymentMethod(models.Model):
name = models.CharField(max_length=50)
is_active = models.BooleanField(default=True)
@siumhossain
siumhossain / test.py
Created October 28, 2024 05:02
ipn listen
async def ipn_listener_view(
status: str,
tran_id: uuid.UUID,
val_id: str,
amount,
store_amount,
card_type: str,
card_no: str,
currency: str,
bank_tran_id: str,
@siumhossain
siumhossain / test.html
Created October 6, 2024 17:38
sku combination generator
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
</head>
<body>
<div x-data="variantApp()" class="p-4">
@siumhossain
siumhossain / 1.html
Created February 6, 2024 08:58
html details
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Game - User details</title>
<script src="https://cdn.tailwindcss.com"></script>
<script
defer
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"
@siumhossain
siumhossain / locustfile.py
Last active September 11, 2023 06:29
video streming test
from locust import HttpUser, task, between
import re
class QuickstartUser(HttpUser):
def extract_links(self, response_content):
pattern = r'(/encrypted_video/[^ ]+\.ts)'
links = re.findall(pattern, response_content)
print('links \n',links)
@siumhossain
siumhossain / 1.md
Created July 31, 2023 06:52
Home page data api needed

Banner section

  • Title - example: Let's learn from the experts!
  • short_description - example: Join iou and explore 500+ courses All on demand, all for USD 25/year

Trending Slider Section

  • Title - example: Explore Our Best Trending Course
  • short_description - example: Sub Title Goes Here

University & company collaboration section

  • Title - example: We collaborate with 200+ leading universities and companies
@siumhossain
siumhossain / 1.js
Last active May 29, 2023 07:20
update specific portion of array after submitting post request in next js
const submitComment = async (e, id) => {
e.preventDefault();
const data = {
comment: commentData,
article: id
}
await axios.post(`${process.env.NEXT_PUBLIC_ROOT_URL}/api/v1/article_comment/`, data, {
headers: { Authorization: `Token ${token}` },
})
.then(res => {
@siumhossain
siumhossain / country_information.csv
Created February 2, 2023 19:15
country_name,country_code,timezones(utc),currency,capital,continent,phone-code etc
name code phone-code continent capital currency timezones
Afghanistan AF 93 Asia Kabul Afghani UTC +04:30
Albania AL 355 Europe Tirana Lek UTC +01:00
Algeria DZ 213 Africa Algiers Dinar UTC +01:00
American Samoa AS 1-684 Oceania Pago Pago Dollar UTC -11:00
Andorra AD 376 Europe Andorra la Vella Euro UTC +01:00
Angola AO 244 Africa Luanda Kwanza UTC +01:00
Anguilla AI 1-264 North America The Valley Dollar UTC -04:00
Antarctica AQ 672 Antarctica None None UTC +11:00
Antigua and Barbuda AG 1-268 North America St. John's Dollar UTC -04:00
@siumhossain
siumhossain / 1.md
Created July 25, 2022 05:48
fiex top and bottom anythig css
.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
}

.fixed-bottom {