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
| #!/bin/zsh | |
| # display-running-apps.sh | |
| # Lists currently running GUI apps on macOS (like Command–L App Switcher) | |
| osascript <<'EOF' | tr ',' '\n' | sed 's/^ *//; s/ *$//' | |
| tell application "System Events" | |
| set app_list to (name of every process whose background only is false) | |
| end tell | |
| return app_list | |
| EOF |
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
| #!/usr/bin/env bash | |
| # ============================================================================== | |
| # make_django_docker_template_kit.sh | |
| # ------------------------------------------------------------------------------ | |
| # PURPOSE: | |
| # Automates the creation of a reusable **Django + Docker Compose** template kit. | |
| # Generates all directories and placeholder files needed to start a new | |
| # containerized Django project, including Docker, Compose, Makefile, and docs. | |
| # | |
| # USAGE: |
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
| # language: Makefile | |
| # ============================================================================== | |
| # Makefile.django-docker-helper | |
| # ------------------------------------------------------------------------------ | |
| # Helper Makefile for Django + Docker Compose development. | |
| # | |
| # PURPOSE: | |
| # - Simplify common Django and Docker workflows. | |
| # - Provide short aliases for build, run, migrate, backup, test, and more. | |
| # - Encourage consistent developer operations across environments. |
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
| from typing import List, Tuple | |
| def _reconstruct_subset(items: List[int], reachable_history: List[int], target_sum: int) -> List[int]: | |
| """ | |
| Reconstruct one subset of `items` that achieves `target_sum` using the | |
| saved DP snapshots in `reachable_history`. | |
| """ | |
| subset: List[int] = [] | |
| cur_sum = target_sum |
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
| #!/usr/bin/env python3 | |
| """ | |
| This module provides a class and utility functions to analyze and infer SQL | |
| types for columns in CSV files via statistical and datatype examination. | |
| It handles various datatypes like integers, floats, booleans, dates, and | |
| timestamps while accommodating dialect-specific SQL type mappings. Additional | |
| functionality includes updating statistics across data chunks, robustness | |
| against missing or invalid data, and generation of NULL/NOT NULL constraints. | |
| """ |
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
| #!/usr/bin/env python3 | |
| """ | |
| A tool for classifying and moving CSV files based on column headers. | |
| This script processes CSV files by matching their headers against predefined | |
| layouts. Depending on the matched layout, the files are moved to their | |
| corresponding destination directories. The script supports both file-based | |
| and directory-based classification and offers options for dry-run execution, | |
| recursion, and verbose output. |
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
| #!/usr/bin/env python3 | |
| """ | |
| A program to concatenate Excel files in a directory. | |
| This script combines all `.xlsx` files present in a specified directory, ensuring | |
| they each have identical and consistent columns (order-sensitive). The combined | |
| data is written into a single output Excel file. Additionally, duplicate rows are | |
| dropped from the final result, and the index is reset. An output file name can | |
| either be provided via the command-line arguments or auto-generated based on | |
| the current timestamp. |
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
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| from openpyxl import load_workbook | |
| from openpyxl.utils import get_column_letter | |
| from openpyxl.workbook.workbook import Workbook | |
| from openpyxl.worksheet.table import Table, TableStyleInfo |
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
| #!/usr/bin/env bash | |
| # shellcheck shell=bash | |
| # Bash wrapper to run Python scripts using a virtual environment. | |
| set -Eeuo pipefail | |
| # Constants | |
| readonly HOME_DIR="${HOME}" | |
| readonly VENV_DIR="${HOME_DIR}/path/to/venv" | |
| readonly VENV_BIN="${VENV_DIR}/bin" |
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
| #!/usr/bin/env python3 | |
| import pandas as pd | |
| import numpy as np | |
| def normalize_missing( | |
| df: pd.DataFrame, | |
| targets=None, | |
| columns=None, | |
| output_dtype="object" | |
| ) -> pd.DataFrame: |
NewerOlder