Skip to content

Instantly share code, notes, and snippets.

View GeorgiyDemo's full-sized avatar

Demka GeorgiyDemo

View GitHub Profile
class ValA:
def __init__(self, obj):
self.obj = obj
def get(self):
return self.obj
def set(self, obj):
self.obj = obj

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
import pyautogui
import time
import random
time.sleep(5)
while True:
pyautogui.moveRel(100, 0)
time.sleep(1)
pyautogui.moveRel(0, -100)
time.sleep(1)
@GeorgiyDemo
GeorgiyDemo / pg_stat_statements.sql
Created July 13, 2022 21:09
Check performance of Postgres DB via pg_stat_statements lib
SELECT
substring(query, 1, 50) AS short_query,
round(total_exec_time::numeric, 2) AS total_exec_time,
calls, round(mean_exec_time::numeric, 2) AS mean,
round ((100 * total_exec_time / sum(total_exec_time::numeric) OVER ())::numeric, 2) AS percentage_overall
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 35;