I decided to move back from Ubuntu (23.04) to Debian (Bookworm), essentially because the Snap package management system just annoyed the hell out of me. The one significant thing that broke was Shotwell. Debian Stable is stable precisely because it's not at the bleeding edge, and the version of Shotwell it ships with is older than that in Ubuntu 23.04, to the extent that the databases are incompatible.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns latest-version | |
"Find the most current stable version identifier of a Clojure (and Java) package." | |
;; This builds on Yannick Scherer's [ancient-clj](https://github.com/xsc/ancient-clj), | |
;; which in turn builds on Chas Emerick's | |
;; [pomegranate](https://github.com/clj-commons/pomegranate/). It goes without saying | |
;; that I could not have done this without them. | |
;; Usage: (latest-stable-version 'org.jmonkeyengine/jme3-core) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns getstarstar | |
(:require [camel-snake-kebab.core :refer [->camelCase ->kebab-case-keyword]]) | |
(:import [clojure.lang Keyword] | |
[java.io File])) | |
;; What this is about: Ertuğrul Çetin's [jme-clj](https://github.com/ertugrulcetin/jme-clj) | |
;; contains a very elegant `get*` macro which constructs the name of a java | |
;; gatter instance method on the fly and then calls that method. This allows you to get | |
;; an arbitrary instance value from a java 'bean'. It's very neat. But sometimes | |
;; you will want to get many instance values from the same object, and to return them as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/blog/js/jquery-3.7.0.min.js" type="application/javascript"></script> | |
<div class="social-media"> | |
<hr/> | |
<h4>Recent Mastodon posts</h4> | |
<ol id="mastodon"></ol> | |
<script type="text/javascript"> | |
const RSS_URL = "https://mastodon.scot/@simon_brooke.rss"; | |
function getRSSFeed(feed, target) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def pid | |
"OK, this is hacky as fuck, but I hope it works. The problem is that the | |
way to get the process id has changed several times during the history | |
of Java development, and the code for one version of Java won't even compile | |
in a different version." | |
(let [java-version (read-string (apply str (take 2 | |
(split | |
(System/getProperty "java.version") | |
#"[_\.]")))) | |
cmd (case java-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns migrate | |
" | |
## Leiningen to deps.edn migration tool | |
I'm as yet unpersuaded of the merits of `deps.edn` vis-a-vis leiningen. | |
Leiningen puts all the metadata about your project and how to build it | |
in one place in a clear, well understood and easily-extensible format. | |
The `deps.edn` format intentionally does not. | |
Worse, `clojure.cli` uses a subtly but significantly different algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn bargraph | |
"Quick'n'dirty bargraph from these `freqs`, the output from the function | |
`clojure.core/frequencies`." | |
[freqs] | |
(let [u (/ (apply max (vals freqs)) 20) | |
p (/ (apply +' (vals freqs)) 100)] | |
(join "\n" | |
(map #(format "%7d : %s (%d %%)" | |
% | |
(apply str (take (/ (freqs %) u) (repeat "#"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/awk -f | |
BEGIN { | |
FS=","; | |
OFS=", "; | |
print("delete from covid;"); | |
} | |
NR > 1 { | |
$1 = gensub( /(.*)/, "'\\1'", 1, $1); | |
$7 = gensub( /(.*)/, "'\\1'", 1, $7); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns walkmap.tag | |
"Code for tagging, untagging, and finding tags on objects. Note the use of | |
the namespaced keyword, `:walkmap.tag/tags`, denoted in this file `::tags`. | |
This is in an attempt to avoid name clashes with other uses of this key." | |
(:require [clojure.set :refer [difference union]])) | |
(defn tagged? | |
"True if this `object` is tagged with each of these `tags`." | |
[object & tags] | |
(if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set the timestamp of the JPEG files which are specified as arguments to the current | |
# date, if its timestamp is zero. | |
# | |
# Background: My Olympus E20p, which I like and still use, is so old that it has no | |
# clock, and doesn't timestamp photographs. In order that Shotwell should file them | |
# properly, I like them timestamped. | |
# | |
# Weirdly, although the timestamp appears in the EXIF as it comes off the camera as |
NewerOlder