I needed to display some hover text in a web app that I am using tailwind and jinja on. It has no js, and no build other than the tailwind. I want this to remain simple. Turns out that you can use a span with a title attribute to get hover text in HTML.
<p>
I needed to display some hover text in a web app that I am using tailwind and
jinja on. It has no js, and no build other than the tailwind. I want this to
remain <span style='cursor: help; color:yellow;' title='respective to the
python developer I am and the team it is used for'>simple</span>.
</p>
Today I learned how to use tar over ssh to save hours in file transfers. I keep all of my projects in ~/git (very creative I know, I’ve done it for years and haven’t changed). I just swapped out my main desktop from bazzite to hyprland, and wanted to get all of my projects back. Before killing my bazzite install I moved everything over (16GB of many small files), it took over 14 hours, maybe longer. I had started in the morning and just let it churn.
This was not going to happen for re-seeding all of my projects on my new system, I knew there had to be a better way, I looked at rsync, but for seeding I ran into this tar over ssh technique and it only took me 6m51s to pull all of my projects off of my remote server.
ssh [email protected] 'tar -C /tank/git -cpf - .' \
| tar -C "$HOME/git" -xpf -
store
I’ve been leaning on lazy-self-installing-python-scripts more and more, but I did not realize how much tooling that uv gives you to help manage your scripts.
uv init --script up
uv add --script up typer rich
uv remove --script up rich
sed -i '1i #!/usr/bin/env -S uv run --script' up
chmod +x up
./up
The result is a script that looks like this, its executable as what looks like regular command in your shell.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "typer",
# ]
# ///
def main() -> None:
print("Hello from up!")
if __name__ == "__main__":
main()
When To Vibe Code
This one is one that I’ve been using quite often, I did’t have a hotkey for it,
I just used the rm shell command.
!!rm %<TAB><CR>
When you type !! from normal mode it will automatically put you in command
mode with .! pre-filled, then you just type rm and <TAB> to
auto-complete the current file name, and <CR> to execute the command.
:.!rm %<TAB><CR>
Making it better #
The one quirk that I don’t like about this is that the buffer remains open
after deleting, and sometimes I forget to close it and end up re-creating it by
mistake when running :wall or :xall.
Create a DeleteFile command with vim command.
:command! DeleteFile execute "!rm %" | bdelete!
Create a DeleteFile command with lua.
vim.api.nvim_create_user_command(
'DeleteFile',
function()
-- Delete the current file from disk
vim.cmd('!rm %')
-- Close the buffer without saving
vim.cmd('bdelete!')
end,
{}
)
Keycap Cut Away
Knife Sharpener Small Upgrade
Vim :noa is a command that runs what you call without autocommands on. This
is typically used when you have some BufWritePre commands for formatting,
most auto formatters are implemented this way in vim. It can be super useful
if you have something like a yaml/json file that you have crafted perfectly how
you want it, maybe it has some source code for a small script or sql embeded
and your formatter wants to turn it into one line. You could get a better
formatter, but for these one off cases that aren’t a big bother to me I run
:noa w.
:noa w