Skip to content

Instantly share code, notes, and snippets.

@itrewm
itrewm / gist:3594d70a1df6f287deb6aeefceb53c1b
Created October 16, 2023 18:33
free tether to toman api | ای پی آی تبدیل تتر به تومان
import requests
from bs4 import BeautifulSoup
url = 'https://wallex.ir/calculator/usdt-tmn'
response = requests.get(url)
response.raise_for_status()
html = response.text
@itrewm
itrewm / sqlite.py
Last active November 7, 2023 18:59
Object-oriented SQLite database
import pathlib
import sqlite3
import logging
PATH = pathlib.Path(__file__).parent.resolve()
class Database:
def __init__(self) -> None:
@itrewm
itrewm / chatgpt_trial_usage.py
Created March 22, 2023 21:13
Get Free trial usage amount in ChatGPT
# Python code
# api endpoint -> https://api.openai.com/dashboard/billing/credit_grants
import requests
api_key = 'Your-Token'
response = requests.get(
'https://api.openai.com/dashboard/billing/credit_grants'
,headers={
"Authorization": f"Bearer {api_key}"