This file contains detailed instructions for setting up common services such as Portainer, Dozzle, and LocalStack locally using Docker and Docker Compose. It also includes steps to configure LocalStack to work with the AWS CLI and Python SDK (Boto3) as a local replacement for AWS services for testing purposes. For example, you can test services like S3, DynamoDB, SSM, and Secrets Manager. For the full list of supported services, please visit the documentation link.
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
// Zed keymap | |
// | |
// For information on binding keys, see the Zed | |
// documentation: https://zed.dev/docs/key-bindings | |
// | |
// To see the default key bindings run `zed: open default keymap` | |
// from the command palette. | |
[ | |
{ | |
"context": "Workspace", |
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 re | |
from IPython.display import Markdown, clear_output, display | |
from openai import Stream | |
def map_citations(content, citations): | |
pattern = re.compile(r"\[doc(\d+)\]") | |
segments = pattern.split(content) | |
doc_numbers = [] |
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
default_language_version: | |
python: python3.12 | |
files: '.py' | |
default_stages: [commit] | |
fail_fast: true | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v5.0.0 | |
hooks: |
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
@pytest.fixture(scope="session") | |
def engine() -> Generator[Engine, None, None]: | |
suffix: str = "test" | |
parsed_url = urlparse(settings.DATABASE_URL) | |
database_url = urlunparse( | |
parsed_url._replace( | |
path=f"/{parsed_url.path.lstrip('/')}_{suffix}", | |
query=urlencode(parse_qs(parsed_url.query), doseq=True), | |
) | |
) |
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 shutil | |
from tempfile import mkdtemp, gettempdir | |
from os import path, makedirs, unlink | |
def compress_dir(src_dir, dest_path, dest_filename=None, skip_files = ["node_modules", ".git", ".venv"], compression="bz2"): | |
temp_dir_path = path.join(gettempdir(), path.basename(src_dir)) | |
if path.exists(temp_dir_path): shutil.rmtree(temp_dir_path) | |
makedirs(temp_dir_path) | |
compression_map = { |
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
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
<? | |
// Link image type to correct image loader and saver | |
// - makes it easier to add additional types later on | |
// - makes the function easier to read | |
const IMAGE_HANDLERS = [ | |
IMAGETYPE_JPEG => [ | |
'load' => 'imagecreatefromjpeg', | |
'save' => 'imagejpeg', | |
'quality' => 100 |
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).