This guide was written for personal documentation and does not comprehensively cover the process in detail, but for someone who needs help, this will hopefully have enough detail to build SQLCipher without excessive googling.
Operating System:
"""Find and (optionally) replace over multiple files using a glob pattern. | |
Give a glob pattern to specify which files to iterate over. | |
Example glob patterns: | |
*.txt - Iterate over all .txt files just in the directory | |
**/*.txt - Iterate over all text files in the directory | |
and subdirectories. | |
project_* - Iterate over all files just in the directory | |
starting with project_. |
https://sqlite.org/datatype3.html#storage_classes_and_datatypes
As SQLite does not natively support storing unsigned 64-bit integers, there are different workarounds to choose from, such as:
Storing unsigned integers in a TEXT column
This is the easiest choice as it can easily be written by hand, printed, and through SQLite's dynamic typing, supports arithmetic within queries (for example, bit shifting).
Note
Hey there! This gist has been rewritten in my GitHub blog. You should read that instead!
You might have seen the -m
flag used in various python commands online,
""" | |
A command tree that maintains a cache of AppCommand objects, | |
helpful for mentioning slash commands in messages. | |
Reference: https://gist.github.com/Soheab/fed903c25b1aae1f11a8ca8c33243131 | |
""" | |
from discord import AppCommandType | |
from discord.abc import Snowflake | |
from discord.app_commands import ( | |
AppCommand, |
import asyncio | |
import concurrent.futures | |
import contextlib | |
import functools | |
import threading | |
from contextvars import ContextVar | |
from typing import Callable, Coroutine, ParamSpec, TypeVar | |
P = ParamSpec("P") | |
Y = TypeVar("Y") |
""" | |
Demonstration 1 | |
=============== | |
This shows a write transaction temporarily blocking another | |
write transaction while read transactions are being performed | |
concurrently. This is the typical behaviour expected from SQLite | |
using the default configuration. | |
DATABASE_PATH = 'main.db' | |
N_READERS = 3 |
from typing import Any, AsyncGenerator, Coroutine, Generator, Generic, TypeVar | |
T = TypeVar("T") | |
U = TypeVar("U") | |
class FutureLike(Generic[T, U]): | |
def __init__(self, yield_value: T, return_value: U): | |
self.yield_value = yield_value | |
self.return_value = return_value |
class Request: | |
def __init__(self, body): | |
self.body = body | |
def __await__(self): | |
response = yield self.body | |
return response | |
async def agen_func(): |
import asyncio | |
USE_ASYNCIO_RUN = False | |
class ImaginaryResource: | |
def __enter__(self): | |
print("1. Opening resource") | |
return self |