This file contains 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
"""Python type hinting for the PL/Python language module. Module documentation can be found in various subpages of the plpython docs https://www.postgresql.org/docs/15/plpython.html | |
This file was written by investigating the runtime plpy attributes and by reading the source code https://github.com/postgres/postgres/tree/master/src/pl/plpython | |
""" | |
from contextlib import contextmanager, AbstractContextManager | |
from typing import Union, Optional, Literal, List, Any, Dict, Iterable, ContextManager | |
# spi vals taken from https://github.com/postgres/postgres/blob/8028e294b456bf1539649527fd98b3985fa4752a/src/include/executor/spi.h | |
SPI_ERROR_CONNECT = -1 | |
SPI_ERROR_COPY = -2 |
This file contains 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
from functools import wraps | |
import timeit | |
MAX_DEC_FUNCTION = None | |
def do_nothing_decorator(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
return func(*args, **kwargs) |
This file contains 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
[uwsgi] | |
# thanks to https://www.techatbloomberg.com/blog/configuring-uwsgi-production-deployment/ | |
strict = true | |
socket = :5000 | |
http-websockets = true | |
master = true | |
die-on-term = true | |
memory-report = true | |
wsgi-file = main.py | |
callable = app |
This file contains 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 asyncio | |
from concurrent.futures import ThreadPoolExecutor | |
from functools import wraps | |
from threading import Thread | |
from time import monotonic,sleep | |
import aiohttp | |
import requests | |
# taken from https://gist.githubusercontent.com/demersdesigns/4442cd84c1cc6c5ccda9b19eac1ba52b/raw/cf06109a805b661dd12133f9aa4473435e478569/craft-popular-urls |
This file contains 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
from concurrent.futures import ThreadPoolExecutor | |
import boto3 | |
import traceback | |
from datetime import datetime | |
from aws_utils.throttling import throttle_protected | |
cluster_id = 'j-3KACTKX2AD5D6' | |
steps = [] | |
step_data = {} |
This file contains 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
window._fetchBackup = fetch; | |
fetch = async (...args)=>{ | |
try{ | |
await window._fetchBackup("https://8.8.8.8"); | |
window.dispatchEvent(new Event('internetConnected')); | |
return window._fetchBackup(...args) | |
} |
This file contains 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 sqlite3 | |
import os | |
from io import BytesIO | |
from PIL import Image | |
from pathlib import Path | |
working_directory = Path(__file__).parent | |
db = sqlite3.connect(Path(working_directory, "Ditto.db")) | |
cursor = db.cursor() |
This file contains 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 os | |
import traceback | |
import warnings | |
''' | |
inspired by https://gist.github.com/bennylope/2999704 | |
Allows you to write .env files and use the environment variables in your scripts. | |
Useful for using variable data/secrets during development/staging environment. | |
''' |
This file contains 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
NAICS Code | Industry Description | |
---|---|---|
541519 | Other Computer Related Services | |
541512 | Computer Systems Design Services | |
322121 | Paper (Except Newsprint) Mills | |
517110 | Wired Telecommunications Carriers | |
511210 | Software Publishers | |
334111 | Electronic Computer Manufacturing | |
541611 | Administrative Management and General Management Consulting Services | |
541511 | Custom Computer Programming Services | |
443120 | Computer and Software Stores |