| allowed-tools | description |
|---|---|
Bash(ruff check:*), Bash(ruff format:*), Read(~/.config/ruff/ruff.toml) |
Lint and format codebase using Ruff |
Your goal is to lint and format the codebase using Ruff.
Do the following:
| allowed-tools | description |
|---|---|
Bash(ruff check:*), Bash(ruff format:*), Read(~/.config/ruff/ruff.toml) |
Lint and format codebase using Ruff |
Your goal is to lint and format the codebase using Ruff.
Do the following:
| import re | |
| import time | |
| from dataclasses import dataclass | |
| from functools import lru_cache | |
| from pathlib import Path | |
| from typing import Any, ClassVar, Final, Literal | |
| import boto3 | |
| from botocore.config import Config | |
| from botocore.exceptions import ClientError |
| # /// script | |
| # requires-python = ">=3.12.9" | |
| # dependencies = [ | |
| # "loguru==0.7.3", | |
| # "boto3==1.38.32", | |
| # "rich==14.0.0", | |
| # ] | |
| # /// | |
| import time |
| from pathlib import Path | |
| from typing import Any, Dict, List, Literal, Union | |
| import lancedb | |
| import numpy as np | |
| import pandas as pd | |
| import pyarrow as pa | |
| from lancedb.embeddings import ( | |
| EmbeddingFunction, | |
| EmbeddingFunctionRegistry, |
| #!/bin/bash | |
| set -xe | |
| # The Enviroment where this script will be ran needs to have jq, aws cli and docker installed | |
| # Set parameters | |
| region=$1 | |
| original_aws_profile=$2 | |
| new_aws_profile=$3 | |
| original_aws_account_number=$4 |
| #!/usr/bin/env python | |
| from os import walk | |
| from os.path import join | |
| DIR_PATH='/path/to/dir' | |
| ## Get all pdf files under the dir DIR_PATH | |
| for (dirpath, _, filenames) in walk(DIR_PATH): | |
| full_names = [join(dirpath, fn) for fn in filenames if fn.endswith('pdf')] | |
| break |
| " Ignore compiled files | |
| set wildignore=*.o,*~,*.pyc | |
| set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store | |
| " Configure backspace so it acts as it should act | |
| set backspace=eol,start,indent | |
| set whichwrap+=<,>,h,l | |
| " No annoying sound on errors | |
| set noerrorbells |
| .DS_Store | |
| ~$* | |
| .git | |
| .terraform/ | |
| .venv/ | |
| venv/ | |
| env/ | |
| node_modules/ | |
| __pycache__/ |
| """ | |
| Extracts IPV4 and IPV6 prefix ranges from ip-ranges.json | |
| REF: https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html#aws-ip-download | |
| Author: Praveen Chamarthi | |
| """ | |
| import requests | |
| import json | |
| aws_ipranges_url = "https://ip-ranges.amazonaws.com/ip-ranges.json" | |
| response = requests.get(aws_ipranges_url, stream=True) |
| #!/usr/bin/env bash | |
| # Easier navigation: .., ..., ...., ....., ~ and - | |
| alias ..="cd .." | |
| alias ...="cd ../.." | |
| alias ....="cd ../../.." | |
| alias .....="cd ../../../.." | |
| alias ~="cd ~" # `cd` is probably faster to type though | |
| alias -- -="cd -" | |
| alias srcdgcp="cd ~/dev/sourced/github/deploymentmanager-samples/community/cloud-foundation" |