Skip to content

Instantly share code, notes, and snippets.

View Aristarhys's full-sized avatar
🏠
Working from home

Artem Bashev Aristarhys

🏠
Working from home
  • Russian Federation
View GitHub Profile
@quiver
quiver / README.md
Last active July 19, 2024 07:38
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
@wojteklu
wojteklu / clean_code.md
Last active July 22, 2024 13:54
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

import sys
if not sys.gettrace():
# f_trace doesn't work if settrace isn't set
sys.settrace(lambda a, b, c: None)
def j(n):
def hook(fr, event, arg):
assert event == "opcode"
fr.f_lineno += n
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active July 13, 2024 02:57
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.