Skip to content

Instantly share code, notes, and snippets.

View mthri's full-sized avatar
🦄

Amir Motahari mthri

🦄
View GitHub Profile
@mthri
mthri / prompt.MD
Created August 10, 2024 13:51
ChatGPT4o initial prompt

You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2023-10 Current date: 2024-07-29

Image input capabilities: Enabled Personality: v2

Tools

bio

@mthri
mthri / settings.py
Created September 24, 2024 11:48
print sql query in django
import os
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
'file': {
@mthri
mthri / exception.py
Created November 9, 2024 11:15
Python Decorator for Exception Logging and Telegram Notifications
from functools import wraps
import logging
import time
import requests
logger = logging.getLogger(__name__)
TELEGRAM_NOTIFICATION_BOT = 'YOUR_TELEGRAM_NOTIFICATION_BOT'
TELEGRAM_NOTIFICATION_CHANNEL_ID = 'YOUR_TELEGRAM_NOTIFICATION_CHANNEL_ID'
@mthri
mthri / divar_notifier.py
Created May 9, 2025 11:45
Divar to Telegram Notifier Bot
"""
Divar to Telegram Notifier Bot
This script monitors a filtered Divar page and sends newly posted items to a specified Telegram channel every 60 seconds.
Setup Instructions:
1. Create a Telegram bot using BotFather.
2. Add the bot to your Telegram group or channel.
3. Promote the bot as an admin in your channel so it can post messages.
4. Use @username_to_id_bot to get the numeric ID of your channel (e.g., -1001234567890).