Skip to content

eli64s/dots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆ
β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆ         β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     β–ˆβ–ˆ    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

β—Ž Config files and utility scripts
Visual%20Studio%20Code Python Pytest GNU%20Bash Ruff Git Zsh

line

Overview

This repository contains configuration files and bash scripts to automate various development tasks. The files are organized into directories based on categories like Python, Git, Zsh, and more.

Project Structure

The repository is structured as follows:

.
β”œβ”€β”€ make
β”‚Β Β  β”œβ”€β”€ Makefile-poetry
β”‚Β Β  └── Makefile-uv
β”œβ”€β”€ python
β”‚Β Β  β”œβ”€β”€  noxfile.py
β”‚Β Β  β”œβ”€β”€ conf
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ pyproject-poetry.toml
β”‚Β Β  β”‚Β Β  └── pyproject-uv.toml
β”‚Β Β  β”œβ”€β”€ lint
β”‚Β Β  β”œβ”€β”€ tests
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ behave.ini
β”‚Β Β  β”‚Β Β  └── pytest.ini
β”‚Β Β  └── type-checker
β”‚Β Β      └── mypy.ini
β”œβ”€β”€ scripts
β”‚Β Β  β”œβ”€β”€ builds
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ docker_hub.sh
β”‚Β Β  β”‚Β Β  └── pypi.sh
β”‚Β Β  β”œβ”€β”€ common
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ clean.sh
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ run.sh
β”‚Β Β  β”‚Β Β  └── test.sh
β”‚Β Β  β”œβ”€β”€ cookie-cutter
β”‚Β Β  β”‚Β Β  └── create_structure.sh
β”‚Β Β  β”œβ”€β”€ converters
β”‚Β Β  β”‚Β Β  └── svg_to_png.sh
β”‚Β Β  β”œβ”€β”€ file-system
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ aggregate_docs.sh
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ chunk_docs.sh
β”‚Β Β  β”‚Β Β  └── modify_filenames.sh
β”‚Β Β  └── install
β”‚Β Β      β”œβ”€β”€ local_dependencies.sh
β”‚Β Β      β”œβ”€β”€ local_dependencies_uninstall.sh
β”‚Β Β      β”œβ”€β”€ micromamba.sh
β”‚Β Β      β”œβ”€β”€ migrate_to_uv.sh
β”‚Β Β      β”œβ”€β”€ precommit.sh
β”‚Β Β      └── pyflink.sh
β”œβ”€β”€ vscode
β”‚Β Β  └── settings.json
└── zsh
Β Β   β”œβ”€β”€ .zprofile
	└── .zshrc

Installation

To get started with the utility scripts, build the project from source:

  1. Clone the repository:
❯ git clone https://github.com/eli64s/dots
  1. Navigate to the project directory:
❯ cd dots

Running the Scripts

One of my favorite scripts to use right now is aggregate_docs.sh, which concatenates all files from a GitHub repository into a single file. I've found this script useful when working with language model APIs for providing the model with robust context and up-to-date information.

First, let's view the help message for the script:

❯ bash scripts/file/aggregate_docs.sh -h

Usage: scripts/file/aggregate_docs.sh [-r REPO_URL] [-p POSSIBLE_PATHS] [-o OUTPUT_FILE] [-n REPO_NAME] [-s TO_SEARCH]
  -r REPO_URL       URL of the GitHub repository to clone (required)
  -p POSSIBLE_PATHS Comma-separated list of possible paths to search for markdown files (required)
  -o OUTPUT_FILE    Name of the output markdown file (required)
  -n REPO_NAME      Name of the repository (required)
  -s TO_SEARCH      Pattern to search for markdown files (e.g., "*.md") (required)

To run the script, provide the following arguments:

❯ bash scripts/file/aggregate_docs.sh \
    -r https://github.com/pydantic/pydantic \
    -n pydantic \
    -o pydantic-docs.md \
    -p docs \
    -s "*.md"

Alternatively, make the script executable:

❯ chmod +x scripts/file/aggregate_docs.sh

And run it directly:

❯ ./aggregate_docs.sh \
    -r https://github.com/pydantic/pydantic \
    -p docs \
    -o pydantic-docs.md \
    -n pydantic \
    -s "*.md"

Advanced Configuration

Say you want to clone this repository and use the .zshrc file as your shell configuration, and have quick access to the function under the bash directory. We can set this up by creating symlinks from the repository to your home directory.

  1. Create symlinks from your repository to your home directory:
# Current repository location
❯ DOTS_DIR="/Users/<username>/GitHub/dots"

# Create symlinks
❯ ln -sf "$DOTS_DIR/zsh/.zshrc" "$HOME/.zshrc"
❯ ln -sf "$DOTS_DIR/bash" "$HOME/.zsh/functions"
  1. Add the following line to your .zshrc file to source the utility scripts:
# -- GitHub/dots Repository Integration ---------------------------------------------
DOTS_DIR="$HOME/Projects/GitHub/dots"
DOTS_SCRIPTS="$DOTS_DIR/bash"

# Function to load scripts from directory
function load_scripts() {
	local dir="$1"
	if [ -d "$dir" ]; then
		# Create functions for all scripts instead of aliases
		for script in "$dir"/*.sh; do
			if [ -f "$script" ]; then
				local func_name=$(basename "$script" .sh)
				eval "function $func_name() { $script \"\$@\" }"
			fi
		done
	fi
}

# Load all script directories from dots/bash
for category in $DOTS_SCRIPTS/*; do
	if [ -d "$category" ]; then
		load_scripts "$category"
	fi
done

# Add custom functions directory to fpath
fpath+=("$DOTS_DIR/zsh/functions")
  1. Now you can run the scripts directly from your terminal:
❯ aggregate_docs -r https://github.com/pydantic/pydantic-ai \
			-p docs \
			-o pydantic-ai-docs.md \
			-n pydantic-ai \
			-s "*.md"

This setup maintains the repository structure while making all bash scripts accessible as commands in your shell.

Tip

The scripts directory contains a variety of utilities for automating tasks like environment setup, file operations, and codebase management.

line