| name | explain-diff-html |
|---|---|
| description | Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output. |
Please make me a rich, interactive explanation of the specified code change.
It should have these sections:
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
| import hou | |
| import os.path | |
| def loadHdaLibrary(libPath): | |
| """ | |
| Loads all the HDA files in a folder | |
| @param libPath: HDA library file path | |
| """ |
These are the steps required to replace a directory with a submodule in git. Note: Assumes that you are currently working on branch called 'develop'
git checkout -b creating-submodulerm -rf path/of/directory/to/be/replacedgit add . then git commit -m "removing local directory"git submodule add "https://github.com/repoName" path/of/directory/to/be/replacedgit add . then git commit -m "adding submodule"git checkout developgit submodule foreach git fetch --tags then git submodule update --init --recursiveSpawning multiple ffmpeg processes with xargs:
On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:
$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"
This will find all files with the ending .avi in the directory Videos/ and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2 to xargs, which starts up to two processes in parallel.
| Question: | |
| . How to run Ansible without specifying the inventory but the host directly? | |
| . Run a playbook or command with arbitrary host not in the inventory hosts list? | |
| . run ansible with arbitrary host/ip without inventory? | |
| Answer: | |
| Surprisingly, the trick is to append a , | |
| The host parameter preceding the , can be either a hostname or an IPv4/v6 address. | |
| ansible all -i example.com, |
| Sometimes that "quick" refactor takes longer than I was planning for. Then it's nice to commit changes to a temporary "dirty" feature branch just to have an off-laptop backup and change history. I use this method for storing a bunch of trash commits on a feature branch and then lifting them back over to master when I want to continue work / clean up. | |
| # Check out the branch you want to start working from | |
| git checkout master | |
| # Check out the dirty "refactor" branch as staged changes | |
| git checkout refactor -- . | |
| # Reset will unstage the changes | |
| git reset |
| { | |
| "AWSTemplateFormatVersion" : "2010-09-09", | |
| "Description" : "This template creates a VPC with a private subnet for the SAP backend and a public subnet with openVPN server.", | |
| "Parameters" : { | |
| "AdminCidrIp" : { | |
| "Type" : "String", | |
| "Description" : "Source CIDR block for administrating the openVPN server", |