Rijksmuseum's online collection is amazing but their search defaults do not suit me.
This script automates searching using my favourite options (restrict to prints, visible online)
#!/usr/bin/env python | |
r""" | |
Update doc metadata by parsing HTML version for images, generating thumbnails of the first admissible image, and updating the metadata with the thumbnail URL. | |
""" | |
from pathlib import Path | |
import subprocess | |
import argparse | |
import logging | |
from ruamel.yaml import YAML |
#!/bin/bash | |
# === VSCode Server Cleanup Script === | |
# Description: | |
# This script cleans up specified VSCode server directories by deleting all | |
# subdirectories except the two most recently modified ones. | |
# | |
# Usage: | |
# ./vscode_cleanup.sh [--dry-run] | |
# |
Copyright CSIRO 2024 | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALI |
As mentioned on my blog, it is helpful to process blog posts to get maximum benefit out of quarto when migrating from blogdown.
This is the script I used. Feel free to use it, modify it and so on.
(c) 2023 Dan Mackinlay
Released under the terms of the MIT license
As per my blog I think quarto is best if you turn it off an on again.
My fix to the many weird bugs and misfeatures in quarto preview
is to continually restart preview server.
I also try to turn off as much “smart” stuff as possible, disabling the file watcher and the browser navigation.
This seems to help both in memory usage and making sure that it serves current content.
Currently I do this manually, by running it in a shell and doing a ^C
to kill it.
I attempted to define a helper function which kills the quarto process and restarts it automatically, but the wily quarto
process seems to evade my attempts to kill it by spawning detached subprocesses or something, so it doesn’t work.
""" | |
An example of the score function gradient estimator, a.k.a. | |
[REINFORCE](http://stillbreeze.github.io/REINFORCE-vs-Reparameterization-trick/) | |
written to provide a concrete example to a blog post on | |
[Monte Carlo gradient estimation](https://danmackinlay.name/notebook/mc_grad.html). | |
This method can estimate very general estimands. | |
In this case we will try to find the parameters which minimises a difference | |
between the categorical distribution we sample from, and some target distrbution. | |
""" |
Asynchronous hyperparam search using Ax and the submitit executor, to run on SLURM.
Supports resumption of incomplete optimisations from disk, and incremental/partial optimisation, I think.
Note: slurm/submitit is now officially supported by Ax
Refs
#! /usr/bin/env python | |
""" | |
Export Zotero biblographies for my blog using betterbibtex export support | |
http://retorque.re/zotero-better-bibtex/exporting/pull | |
Usage: | |
From the root of a blogdown blog, run | |
``` |
This hook warns you before you accidentally commit large files to git. It's very hard to reverse such an accidental commit, so it's better to prevent it in advance.
Since you will likely want this script to run in all your git repos, a script is attached to add this hook to all git repos you create / clone in the future.
Of course, you can just download it directly to the hooks in an existing git repo.