Skip to content

Instantly share code, notes, and snippets.

View anapaulagomes's full-sized avatar

Ana Paula Gomes anapaulagomes

View GitHub Profile
@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;")
@rougeth
rougeth / pybr20-foto-oficial.py
Created November 8, 2020 21:06
Script gerador da foto oficial da Python Brasil 2020
import asyncio
import sys
from pathlib import Path
import discord
from PIL import Image
def gerar_imagem():
imagens = [
#!/bin/bash
# Change the date under CUTOFF_DATE to change how far back you want to delete
# Install the GitHub CLI tool by following the instructions in the official documentation: https://cli.github.com/manual/installation
# Make sure you auth first to github with 'gh auth login'
REPO_OWNER="OWNER"
REPO_NAME="REPO_NAME"
CUTOFF_DATE=$(date --date='30 days ago' +'%Y-%m-%dT%H:%M:%SZ')
PAGE=1
@bitsnaps
bitsnaps / polars.md
Last active April 6, 2025 02:21
A cheat sheet for polars python package

Polars Cheat Sheet

Here's a cheat sheet for the Polars Python package, covering many of its key functions and features:

Installation

pip install polars 

# Install Polars with all optional dependencies:
pip install 'polars[all]'