Skip to content

Instantly share code, notes, and snippets.

@kissgyorgy
kissgyorgy / listen.py
Created September 4, 2020 16:37
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")
@marcorichetta
marcorichetta / postgresql-manjaro.md
Last active March 17, 2025 00:07
Install PostgreSQL on Manjaro and set it up for Django
@ibraheem-ghazi
ibraheem-ghazi / install-redis.sh
Created December 5, 2019 12:46
Bash script to install Redis on Ubuntu server protected with OpenSSL password
#!/bin/bash
clear
#color the output of echo
COLOR='\033[1;32m'
RED='\033[0;31m'
WHITE='\033[1;37m'
NC='\033[0m' # No Color
@Bluexin
Bluexin / msys2.md
Last active February 14, 2025 18:22
Setting up qtcreator with msys2 on windub
@BoGnY
BoGnY / README.md
Last active April 22, 2025 17:56
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@TheKewlStore
TheKewlStore / item_data.py
Last active August 3, 2022 14:06
PyQt4 QAbstractItemModel subclasses
""" Define a data container to be used with model subclasses that emits a generic signal whenever data in the internal dictionary
is changed. This creates a consistent API layer with model items that can be edited programatically as dictionaries, and
automatically kept synchronized in the model and the view.
"""
__author__ = 'Ian Davis'
__all__ = ['ItemData', ]
from api.util.event_util import Signal