| 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:
| # Create a new worktree and branch from within current git directory. | |
| ga() { | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: ga [branch name]" | |
| exit 1 | |
| fi | |
| local branch="$1" | |
| local base="$(basename "$PWD")" | |
| local path="../${base}--${branch}" |
If you sometimes find yourself needing to share a file over HTTP, there are not many file-sharing solutions you can use.
This action works by publishing files via GitHub Pages behind an obscure prefix path. It updates the repository README with the URLs, so that you have links to the published files.
You can keep the repository secret, and the files are public but semi-secret, so you can share them without concern that other files will be discovered.
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text.Json; | |
| using System.Text.Json.Nodes; | |
| namespace CajunCoding | |
| { | |
| public static class SystemTextJsonMergeExtensions | |
| { |
This gist kept getting bigger and bigger, so I moved it to a proper repository, complete with a proper NuGet package.
There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.
Consider adopting the new property pattern, wherever you use IsNullOrEmpty.
string? hello = "hello world";| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace System.Collections.Immutable | |
| { | |
| public class ImmutableListWithValueSemantics<T> : IImmutableList<T>, IEquatable<IImmutableList<T>> | |
| { | |
| IImmutableList<T> _list; | |
| public ImmutableListWithValueSemantics(IImmutableList<T> list) => _list = list; |
Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct