I have a parquet file named ah.parquet.
It contains Apple Health data and has the following columns:
- type: Nullable(String)
- value: Nullable(String)
- start: Nullable(DateTime64(6))
- end: Nullable(DateTime64(6))
- created: Nullable(DateTime64(6))
| #!/usr/bin/env bash | |
| # | |
| # A Bash script to run a TDD loop for building a Python module to pass tests. | |
| set -euo pipefail | |
| # How many times to loop. | |
| ATTEMPTS=4 | |
| # The system prompt to use when creating the initial version. |
| #!/bin/bash | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 <input_video>" | |
| exit 1 | |
| fi | |
| input_file="$1" | |
| if [ -z "$2" ]; then |
| """ Simple code editor using textual. Live coded during the lightning talk in about 7 minutes | |
| """ | |
| from argparse import ArgumentParser | |
| from pathlib import Path | |
| from textual.app import App | |
| from textual.widgets import TextArea, DirectoryTree | |
| from textual.containers import Horizontal | |
| class Editor(App): |
I have a parquet file named ah.parquet.
It contains Apple Health data and has the following columns:
| import json | |
| import urllib.parse | |
| from dataclasses import InitVar, dataclass | |
| from datetime import datetime, timedelta | |
| from typing import Protocol | |
| import httpx | |
| import llm | |
| import streamlit as st |
| llmc() { | |
| local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.' | |
| local temp_file=$(mktemp) | |
| local capturing=true | |
| local command_buffer="" | |
| local first_line=true | |
| local cleaned_up=false # Flag to indicate whether cleanup has been run | |
| cleanup() { | |
| # Only run cleanup if it hasn't been done yet |
| This uses llm.datasette.io and OpenAI. | |
| I use `git commit --template` to provide the output from the LLM to Git. This way, if you do not like the results, you | |
| can quit your editor and no commit will be made. | |
| # Shell function for generating a diff and editing it in your default editor: | |
| gcllm() { | |
| GIT_DIR="$(git rev-parse --git-dir)" | |
| TEMPLATE="$GIT_DIR/COMMIT_EDITMSG_TEMPLATE" |
| function speak_ollama() { | |
| if ! command -v ollama &> /dev/null; then | |
| echo "Error: ollama is not installed." | |
| return 1 | |
| fi | |
| if [ "$#" -ne 2 ]; then | |
| echo "Usage: speak_ollama <file_path> <model>" | |
| return 1 | |
| fi |
| #!/bin/zsh | |
| # #popclip | |
| # name: Azure TTS | |
| # icon: symbol:message.and.waveform | |
| # Please apply for your own key | |
| AZURE_REGION= | |
| AZURE_SUBSCRIPTION_KEY= | |
| # Create a temporary audio file |
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # Version: 08-2024 | |
| # Migrated to: https://github.com/mrjk/python_snippets/blob/main/examples/typer/cli-app-typer.py | |
| """MyApp CLI interface | |
| This CLI provides a similar experience as the git CLI, but in Python with Typer. |