Seen in the wild: replace all the newlines with a literal $ in sed:
sed -e 's/$/$/'
It's always bugged me that regex replace syntax looks similar to regex, occurs close to the search syntax, but actually has a different meaning. It's harder to read.
miniblog.
Related Posts
I'm pretty impressed with Cursor: I've successfully asked it to perform codebase transforms in English, and it's worked!
E.g. "Replace all calls foo(..., true) with foo_immediate(...) define a foo_immediate function".
I'm still reading the diff and checking tests -- it's still AI after all.
I tried replace Vec with SmallVec in a really hot loop in difftastic, and it's a huge speedup. It almost *halved* the runtime of one of my test files!
I've done a lot of performance tuning of difftastic, so it's surprising to see such a big win.
https://crates.io/crates/smallvec
zmv is a mv alternative bundled with zsh that has an expressive globbing syntax. In many cases it can replace loops, and it even has a dry run option!
https://filipe.kiss.ink/zmv-zsh-rename/