Reverse Proxy in shadow-cljs

03 March 2026

I’ve broken my reverse proxy configuration in shadow-cljs multiple times, so I need a reminder for myself.

I have the server-side api running in a container, and the CLJS is running in shadow-cljs in dev mode.

With a :proxy-url set, shadow-cljs will forward any request it can’t match with a file in the root to the other server. This helps avoid Cross-Site-Request-Forgery failures in the browser during development.

 :dev-http {3000 {:root "public"
                  :proxy-url "http://localhost:7000/my-backend-service"}}

The important part is to ensure the URL lacks the trailing slash. With the slash, I see lots of not-found errors from the backend server for everything but the default index.


Teach the AI to Unit Test

19 February 2026

The Gemini AI will make some pretty good guesses about how a 3rd-party API may work. It is good at searching the internet, but when APIs have changed across versions, the old and new docs and examples it’ll find can confuse it. In a dynamic language and environment you’ll not spot these errors until runtime.

To combat the ambiguity and to give the AI agent more power to solve its own problems, ask it to add some tests around the code that uses the API. (In my case, the API is the XTDB client API.) Once it has a way to execute the code through tests, it’ll quickly start figuring out where it’s made mistakes and start running its own experiments to observe errors, search for fixes, and applying those fixes around the codebase. I exhibit the same pattern when I’m doing it by hand.

The tests also give you, the human, an easier entry point to evaluate the code the AI generated. If the tests look gnarly, you know to suggest refactorings to improve the architecture and make it easier to test. When the AI has the tests passing, and the test code is easy enough to read, then you can have a closer look at the application code to refine and keep that maintainable too.


Ask the AI

09 February 2026

Gemini CLI is getting even stronger for Clojure code. The clojure-mcp is part of that power: it’s exploring the code and fixing up syntax quicker now.

In addition to writing code, it’s been good at listing and implementing optimizations and refactorings to improve the code when asked.

I’d still like to remind you to ask the AI to explain itself. It’s still our responsibility to understand what it’s doing and to question its decisions, just like we would to get the best we can from any other teammate. It’s our opportunity to learn and understand too from a very comprehensive summary of all the internet searches I used to need to do for myself.


Remapping the CoPilot Key on IdeaPad with Keyd and CW

19 January 2026

The CoPilot Key

The Lenovo IdeaPad 5 has a CoPilot where it should have a Control Key. The key simulates a combination of keys, so normal ways of mapping the key (udev/hwdb.d on Debian) do not work. keyd can hook the key, though, and present another virtual keyboard device.

USB Adapter for CW Keys

There are inexpensive USB adapters that allow plugging a CW key or Iambic paddle into the computer for use with vBand or other games. The adapter presents as a keyboard, and the paddles show up as additional Left and Right Ctrl keys. If you are running keyd on the machine, its default behavior of mapping Right Ctrl to be Left Ctrl (which I guess lots of people find useful) will interfere and cause both sides of the paddle to trigger the same dit or dah. Fortunately, we can undo this broken behavior to get the key working again.

The Complete Configuration

Create /etc/keyd/default.conf:

[ids]
*

[main]
# copilot key
leftshift+leftmeta+f23 = rightcontrol
# keep right ctrl as it is. keyd by default remaps it to left ctrl for some reason
rightcontrol = rightcontrol

Restart keyd: systemctl restart keyd

Testing

After the mappings have been applied, you can be observe it with evtest. You’ll also see the key working in vBand.

I wouldn’t have needed keyd if it wasn’t for needing to remap the useless CoPilot key.


All the Posts

March 2026

February 2026

January 2026

December 2025

November 2025

August 2025

March 2025

August 2024

February 2023

January 2023

November 2022

April 2022

January 2022

July 2021

April 2021

January 2021

November 2020

October 2020

January 2018

January 2016

December 2012

October 2011

June 2011

December 2010

September 2010

June 2010

May 2010

February 2010

January 2010

August 2009

March 2009

February 2009

November 2008

October 2008

June 2008

March 2008

January 2008

December 2007

October 2007

September 2007

August 2007

July 2007

June 2007

May 2007

April 2007

March 2007

February 2007

January 2007

December 2006

November 2006

October 2006

September 2006

August 2006

July 2006

June 2006

May 2006

April 2006

March 2006

February 2006

January 2006

December 2005

November 2005

October 2005

September 2005

August 2005

July 2005

June 2005

May 2005

April 2005

March 2005

February 2005

January 2005

December 2004

November 2004

October 2004

September 2004

August 2004

July 2004

June 2004

May 2004

April 2004

March 2004

February 2004

January 2004

December 2003

November 2003

October 2003

September 2003

August 2003