getting rid of extra mkdir commands in Makefile
This site is built with one medium-complicated
Makefile, and there are quite a few places where there is a
mkdir in a recipe before some other file gets copied into
place under /public/.
I managed to get rid of some of those.
Copy a file and create destination directory
Replace a mkdir and cp with
install using the -D option to create the
destination directory if needed. Before:
public/i/% : i/%
mkdir -p public/i
cp $< $@
chmod 644 $@After:
public/i/% : i/%
install -m 644 -D $< $@Create destination directory in a Python script
This is one extra line, using pathlib
Before opening the output file for writing,
Path(outfile).parent.mkdir(parents=True, exist_ok=True)This creates a Path object for the intended pathname of the output file, gets its parent directory, and makes that directory and all parents if it does not exist.
So I know this blog still starts a lot of processes to rebuild, but I got rid of a few.
Bonus links
Community Gardens in Jean Sweeney Open Space Park by Margie Siegal. (My prediction is that the nutritional benefit will be dwarfed by the people skills building benefit. Any cooperative project is good for getting better at any other cooperative project.)
The Company That Published Fake Journalists in Sports Illustrated is Collapsing Dramatically After Massive AI Rebrand by Maggie Harrison Dupré. (People are obviously getting off the slop and touching grass. Or rutabagas or whatever they’re growing in their community garden plots.)
CEO of Palantir Says AI Will Seize Power Away From College-Educated Women by Frank Landymore. (Oh, never mind, I heard this dude is progressive now?)
Apple suddenly shutters its Support Community forums for no clear reason by David Price. (The reason is clear if you read the forums. A lot of regular people’s questions about Apple products are stuff like, what’s this confusing, creepy-looking advertising feature or “how do I turn off this AI slop that started showing up? Apple had to decide whether to pay attention to real customer concerns and fix the stuff that forum posters are on about, invest a bunch of moderator hours in a Potemkin village makeover, or just shut the forums down.)
Creators
quit pro-AI platforms, summary by Thomas McKinlay of a paper by
Huang, H., Fu, R., & Ghose, A. If you work in social media
(e.g. influencer marketing), pay attention to the AI stance of the
platforms you’re investing in. The platforms that are investing the most
in AI (e.g. X, Quora) will likely see decreasing engagement from
creators.
(Human YouTubers are trying to stand out from the slop by
doing AI-free collabs and encouraging users to rely on subscriptions
more, algorithms less. Related: cleaning up
YouTube)
THE
FIRST LESSON IS: NO ONE’S EVEN LOOKING by Dave Trott. I think
most people in our business believe ordinary people will notice every ad
and study each ad carefully….[W]e are each exposed to roughly 1,000 ads
per day. Of that, 4% are remembered favourably and 7% are remembered
unfavourably. But the important number is – 89% of advertising isn’t
noticed or remembered.