Skip to content

Instantly share code, notes, and snippets.

View anapaulagomes's full-sized avatar

Ana Paula Gomes anapaulagomes

View GitHub Profile
#!/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
@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 = [
@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;")
@lucianoratamero
lucianoratamero / README.md
Last active May 5, 2023 06:48
Export Gnome settings and extensions python script

migrate_gnome_settings.py

This script makes it easier to copy Gnome settings and extensions from one pc to the other. It supports python>=3.5.

To use it, download it, then run python3 migrate_gnome_settings.py --export-settings to create a tar.gz file with all the settings.

Then, on your new system, copy the script and the gzip to your user's home directory and run python3 migrate_gnome_settings.py --import-settings.

For now, the script migrates:

Data Structures
- Stacks
- Queues
- Linked lists
- Graphs
- Trees
- Tries
Concepts
- Big O Notation
@souhaiebtar
souhaiebtar / dbeaver.ini
Last active April 19, 2024 13:48
[dbeaver config file] .ini file for dbeaver #dbeaver #linux
# path on linux /usr/share/dbeaver/dbeaver.ini
# path on macos /Applications/DBeaverEE.app/Contents/Eclipse/dbeaver.ini
-vm
/usr/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-vmargs
-XX:+IgnoreUnrecognizedVMOptions
@rdmurphy
rdmurphy / aggregates.py
Created May 5, 2018 16:14
PostgreSQL specific Django Median aggregation function
from django.db.models import Aggregate, FloatField
class Median(Aggregate):
function = 'PERCENTILE_CONT'
name = 'median'
output_field = FloatField()
template = '%(function)s(0.5) WITHIN GROUP (ORDER BY %(expressions)s)'
@dvdbng
dvdbng / vim-heroku.sh
Last active April 22, 2024 22:42
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@JamesMenetrey
JamesMenetrey / README.md
Last active September 29, 2022 08:27
Install Oh-My-Zsh + iTerm2 with Solarized + System-wide console in 2017 (macOS)

Install iTerm2 with Solarized in 2017

Here is the looks and feel of your terminal once the tutorial has been applied on your system:

Install iTerm2

Using Homebrew:

@matangover
matangover / Compiling Python with custom OpenSSL on Heroku.md
Last active June 14, 2020 19:24
Instructions for compiling Python with custom OpenSSL on Heroku

Prepare a dyno for compilation with the latest OpenSSL

  1. Create a one-off Heroku app (or use an existing one) for the compilation.

  2. Set the app to use the Python buildpack with OpenSSL 1.0.2g

    heroku buildpacks:set https://github.com/yuvadm/heroku-buildpack-python-openssl-1.0.2.git -a myapp
    
  3. Run a one-off dyno to do the compilation: