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
| Column | Type | Meaning | Rules | |
|---|---|---|---|---|
| entity | string | Thing being measured | Stable label, not human prose | |
| variable | string | What is measured | Atomic, no units | |
| value | numeric | Measured value | Float/decimal only | |
| unit | string | Measurement unit | %, g/100g, mg/L, etc. | |
| basis | string | Unit basis | w/w, w/v, dry, as_is | |
| method | string | Measurement method | Optional | |
| source | string | Source name | File/site/report | |
| source_id | string | Stable source key | URL, DOI, hash | |
| observed_at | string/date | When observed | ISO-8601 |
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 | |
| set -euo pipefail | |
| # mdtable2csv: Convert Markdown tables to CSV. | |
| # Handles alignment rows, trims cells, escapes CSV safely, and respects escaped pipes (\|). | |
| mdtable2csv() { | |
| local in out | |
| if [[ $# -lt 1 || $# -gt 2 ]]; then |
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 | |
| # Create a Django-ish repo (Type_A) | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # --- Config --- | |
| PARENT="${HOME}/name_of_parent_directory" | |
| ROOT="${PARENT}/name_of_django_project" | |
| ENV_DIR="${ROOT}/env" |
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
| # ============================================================================== | |
| # PROJECT: [Insert Project Name Here] | |
| # PURPOSE: Standardized Makefile for Python projects using a virtual environment. | |
| # This file defines common commands for setting up, running, and | |
| # cleaning the project. | |
| # USAGE: Type 'make' or 'make help' to see available targets. | |
| # REQUIRES: make, python3, pip (to be run in a shell environment) | |
| # ============================================================================== | |
| # Define variables for the virtual environment and its executables. |
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 numpy as np | |
| def gaussian_random_reject(a, b, mean=None, std=None, size=1): | |
| """ | |
| Generate Gaussian-distributed random floats strictly within [a, b] | |
| using rejection sampling (no clipping). | |
| Parameters: | |
| a, b : float |
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. | |
| """ |
NewerOlder