1,686 karma · joined March 14, 2022
{
# load compinit and rebind ^I (tab) to expand-or-complete, then compile
# completions as bytecode if needed.
lazyload-compinit() {
autoload -Uz compinit
# compinit will automatically cache completions to ~/.zcompdump
compinit
bindkey "^I" expand-or-complete
{
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
# if zcompdump file exists, and we don't have a compiled version or the
# dump file is newer than the compiled file, update the bytecode.
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
zcompile "$zcompdump"
fi
} &!
# pretend we called this directly, instead of the lazy loader
zle expand-or-complete
}
# mark the function as a zle widget
zle -N lazyload-compinit
bindkey "^I" lazyload-compinit
}You could peek at something like zprezto https://github.com/sorin-ionescu/prezto or pure https://github.com/sindresorhus/pure for tips.
Fetching git/hg/... info is always slow, so try and speed that up where you can (as to how to do that, uhh... I know my prompt has a dirty-state check nicked from pure for speed reasons). You can also cache any `asdf init zsh` or similar to a file and do the same "run in background" trick so the next shell will have any changes.
The biggest improvement I can remember was dropping zprezto for my own much smaller config, I really did not need much comparatively. Mostly some git info and "good default" options. I use zgenom for a plugin manager but only have 3 plugins, probably I should just dump it and inline the plugins to avoid getting owned one day.
autoload -U compinit && compinit
{
# Compile the completion dump to increase startup speed. Run in background.
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
# if zcompdump file exists, and we don't have a compiled version or the
# dump file is newer than the compiled file
zcompile "$zcompdump"
fi
} &!
Using `zmodload zsh/zprof`, I can see about 50% (16ms) of my start up is compinit (its about 28ms without the `zcompile`).Do you have any pointers for the "load on tab" idea? I didn't turn up any good results in DDG and LLMs were just hallucinating.
BTW I believe `-C` will disable some cache checking, caching is enabled by default
> To speed up the running of compinit, it can be made to produce a dumped configuration that will be read in on future invocations; this is the default, but can be turned off by calling compinit with the option -D.
> ...
> ... The check performed to see if there are new functions can be omitted by giving the option -C. In this case the dump file will only be created if there isn't one already.
e: ah, in this very thread https://secretgeek.github.io/html_wysiwyg/html.html
https://www.youtube.com/watch?v=5fOjrQ2N3K0 Ahh,,, guess I'd better go to bed .....
(f) Misrepresentations.—Any person who knowingly materially misrepresents under this section—
(1) that material or activity is infringing, or
(2) that material or activity was removed or disabled by mistake or misidentification,
shall be liable for any damages, including costs and attorneys’ fees, incurred by the alleged infringer, by any copyright owner or copyright owner’s authorized licensee, or by a service provider, who is injured by such misrepresentation, as the result of the service provider relying upon such misrepresentation in removing or disabling access to the material or activity claimed to be infringing, or in replacing the removed material or ceasing to disable access to it.
https://www.law.cornell.edu/uscode/text/17/512#f (scroll up slightly as the anchor-link places the top under the navbar)
Of course its on the proverbial me to prove that they're at fault and I dont have the money or time ...
I imagine one day they will kick the wrong horse though and someone will sue the company for it & GH/GL/whoever for not giving fair recourse or something.
"zsh rename index.html.1 to image_1.png for many images"
Gemini
Here's a zsh script that will rename multiple files named index.html.1 to
image_1.png in your current directory and its subdirectories:
Bash
#!/bin/zsh
# Loop through all files in the current directory and subdirectories
for file in **/index.html.1; do
# Extract the base filename and extension
base_name="${file%.*}"
extension="${file##*.}"
# Rename the file with the new name and extension
mv "$file" "${base_name}_1.png"
# Print a message for each renamed file
echo "Renamed $file to ${base_name}_1.png"
done
ChatGPT3.5 To rename multiple files in zsh, you can use the zmv function. Assuming you
want to rename files from index.html.1 to image_1.png for many images, you
can create a pattern to match the filenames and then define the new names
using capturing groups. Here's an example:
zsh
autoload -U zmv
zmv -n '(*).html.(*)' 'image_$1_$2.png'
Not a great first impression of Gemini. ChatGPTs answer isn't perfect but its a lot closer to correct, only needing me to remove the extra 'index' capture of $1.Curious if someone could commit some light copyright infringement and post what GPT4 says to the same prompt.
Edit: Also Phind-34B probably gives the best answer, with the correct capture.
To rename multiple files in zsh from index.html.1 to image_1.png for many
images, you can use the zmv command, which is a powerful batch renaming tool
available in zsh. If you encounter the error zsh: command not found: zmv, you
can load it using autoload -U zmv 1.
First, ensure zmv is available by adding autoload -U zmv to your ~/.zshrc file
or run it directly in your shell session 2.
Here's how you can use zmv to rename your files:
zmv -n 'index.html.(*)' 'image_$1.png'Growing up after the landing, with science fiction being a pervasive genre, color television, the internet, you can see how to some it might feel like a lot of hurry up and wait.
The perspective of "one day, we might just see that moon up close" to "well duh we are going to mars."
I looked into heat pumps, but cost the of the device + installation + an electrician to run a new line (seemed that would be needed) ... I dont think it was ever going to break even over the rated life span of the system. The cheap ones were still 3 times the price of a gas system, just for the hardware. That and I would have to buy the heatpump from out of town, so getting any warranty/servicing might be more drama. And I really didnt want to listen to a cheap compressor tick-on all the time.
Another sad mark in the "wish I didnt have to kill the planet but ..." column. Feels like a rich mans game.
https://boardgamegeek.com/boardgamecategory/1120/print-play
&
https://boardgamegeek.com/forum/974620/bgg/design-contests
BGGs site is always a bit confusing to me to navigate, but searching for "pnp" or "print and play" and a contest year will probably surface a lot of good "free" (or at least, free to print....) You can at least certainly get a bunch printed for cheaper than 1 boxed game and if you dont like half of them, no drama.
Shutup and sit down has done a few round ups of solo-print-and-plays https://inv.tux.pizza/search?q=shut+up++and+sit+down+print+a.... I'm sure there are people on here that can recommend some +1-player pnp games.
See, I just did it and didn't have to mention Rich Hickey.
I have never heard anyone say that in my entire life. Closest might be "put in the work and with a bit of luck you will succeed" I guess.
(Score: 3, Funny)