This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def patch_geos_signatures(): | |
""" | |
Patch GEOS to function on macOS arm64 and presumably | |
other odd architectures by ensuring that call signatures | |
are explicit, and that Django 4 bugfixes are backported. | |
Should work on Django 2.2+, minimally tested, caveat emptor. | |
""" | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import operator | |
from base64 import b64decode as _unbase64 | |
from base64 import b64encode as _base64 | |
from functools import reduce | |
from django.db.models import Q | |
from graphene import relay | |
from graphql_relay.connection import connectiontypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Simplistic RDS logfile downloader because AWS CLI + Botocore is broken. :-( | |
# | |
from __future__ import print_function | |
import argparse | |
import os.path | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read more at http://www.pindi.us/blog/migrating-cross-domain-cookies-django | |
from django.conf import settings | |
from importlib import import_module | |
class UpdateSessionCookieMiddleware(object): | |
""" | |
Migrates session data from an old (hardcoded) session cookie name and domain to the name and | |
domain currently defined in the Django settings. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read more at http://www.pindi.us/blog/migrating-cross-domain-cookies-django | |
from django.conf import settings | |
from importlib import import_module | |
class UpdateSessionCookieMiddleware(object): | |
""" | |
Migrates session data from an old (hardcoded) session cookie name and domain to the name and | |
domain currently defined in the Django settings. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |