news
Programming Leftovers
-
Ned Batchelder ☛ Making git hooks visible
A git hook is a script in the .git directory of a git repo on your machine. They run during various git operations. The important detail to understand about hooks is that they do not get installed locally when you clone a repo. A newly cloned repo never has active hooks. Hooks have to be enabled after cloning, usually by you.
The attack Frank saw was dangerous because it wasn’t a cloned repo: it was a local checkout that had hooks installed then shared as a Dropbox folder. So when it landed on Frank’s machine, the hooks were active without him realizing it.
-
Lukáš Lalinský ☛ Type-safe HTML templating in Zig
So, let me present zt (I’m not good at naming, sorry). It’s an adaptation of Templ to Zig. The templates are parsed and transpiled to Zig code during zig build. That means you can import them directly from your app code, but also, perhaps even more importantly, the templates can import your app code. As a result, all parameters can be fully typed. If something can’t be rendered, the Zig compiler will tell you so. The generated code is fairly simple, all it does is write to a std.Io.Writer. You can write directly to a socket or accumulate the output in a buffer, your choice. Here is what a template looks like: [...]
-
Lars Thießen ☛ Speeding up the Unreal editor by… not using unnecessarily secure hash methods
One good trick when trying to look for ways to optimize software is to stay away from areas that are very likely already quite well optimized, and instead focus on areas that might have been overlooked, either because they are too obscure or don’t show up during regular profiling sessions. This tactic worked well in the past, as shown with my optimization of tooltip creation, or the loading of editor localization files.
-
Perl / Raku
-
Shell/Bash/Zsh/Ksh
-
Christian Hofstede-Kuhn ☛ The Ansible Guy Finally Automates His Own Patching: FreeBSD, Jails, Proxmox and RHEL
There is a special kind of embarrassment in being the person who explains Ansible to other people during the week and then spends Sunday evening typing freebsd-update fetch install into a dozen SSH sessions.
-