Skip to content

Instantly share code, notes, and snippets.

View J-Yaghoubi's full-sized avatar
💯
Always ready

Seyed Jafar Yaghoubi J-Yaghoubi

💯
Always ready
View GitHub Profile

conect to postgres through psql:

psql -h <host> -U <username> -p <port>

list of users:

\du
@J-Yaghoubi
J-Yaghoubi / sql-cheat-sheet.md
Last active November 22, 2025 15:00
Postgres SQL query cheat sheet
@J-Yaghoubi
J-Yaghoubi / ansi_escape.py
Last active September 2, 2022 02:16
How to use ANSI-escape in python to have colored font and background
import sys
# 256-colored Text
for i in range(0, 16):
for j in range(0, 16):
code = str(i * 16 + j)
sys.stdout.write(u"\u001b[38;5;" + code + "m " + code.ljust(4))
print (u"\u001b[0m")
# 256-colored backgrounds
@J-Yaghoubi
J-Yaghoubi / Git_cheat_sheet.md
Last active March 7, 2024 10:54
Git cheat sheet commands