pip install -r requirements.txt
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
# You can use the builtin json lib to iteratively encode a json object | |
# but encoding a json array iteratively requires the iterable to be list-like | |
# No worries we just subclass list and pretend to be a list while being able to ingest | |
# whatever you want | |
import json | |
import sys | |
class IteratorAsList(list): |
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
#!/usr/bin/python | |
import subprocess | |
import json | |
URL = "https://www.google.com" | |
get_browser_bundle_id = "cat ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist | plutil -convert json -r -o - -- -" |
i have documented here how to do it with env vars: https://gist.github.com/sloev/a5c1a5091abde30a70c14bad37e35a76
it says:
a response to python-poetry/poetry#910
$ cat pyproject.toml
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
const { encode, decode } = require('base2048'); | |
const jsonCipher = require('json-cipher') | |
createCrypto = (secret, algorithm = 'aes-256-cbc') => { | |
const { cipher, decipher, hmac } = jsonCipher(secret, algorithm) | |
return { | |
stringify: object => encode(cipher(object)), | |
parse: string => decipher(decode(string)), | |
cipher, | |
decipher, |
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 requests | |
requests_get = requests.get | |
import OpenSSL | |
def get( | |
*args, retries=5, **kwargs, | |
): |
npm install npm start
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 msgpack | |
from typing import Optional | |
from fastapi import FastAPI, Response | |
from starlette.requests import Request | |
from fastapi.responses import HTMLResponse | |
import crypto | |
import json | |
import secrets | |
app = FastAPI() |
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 sqlalchemy.pool import QueuePool | |
from sqlalchemy import create_engine | |
from contextlib import closing, contextmanager, ExitStack | |
from sqlalchemy.sql import text | |
import asyncio | |
import logging | |
import time | |
class AsyncMysqlDatabase: |