Marginalia Search

A short time before I started following blogs with RSS, I came across Dan Luu’s blog (someone was referring to it as an example of a good looking blog with no CSS at all). It was a treasure trove of well thought-out and very well-written essays. And one of the most interesting pieces is about search engines, where (among others) Luu claims that one of the best search engines around is an indie project called Marginalia Search....

August 1, 2024

Clojure conj: lists v vectors

At this juncture, I noticed an interesting pattern with the behaviour of conj in Clojure. As per ClojureDocs: ;; notice that conjoining to a vector is done at the end (conj [1 2 3] 4) ;;=> [1 2 3 4] ;; notice conjoining to a list is done at the beginning (conj '(1 2 3) 4) ;;=> (4 1 2 3) Why? According to a Perplexity AI answer and my PromptBros agent, it is because:...

July 31, 2024

More ClojureScript Koans

I could only programme for a very short time today, so decided to have another crack at Clojure Koans. This puzzle is a good brain teaser. Dill in the ___ below. (= 25 ( ___ (fn [n] (* n n)))) I was stuck and decided to make a Clojure tutor bot on PromptBros to chat with. Again, it didn’t give the right answers: the apply function (if correctly explained) requires an input after the function, not before....

July 30, 2024

Learn Next.js with the Leviathan

[demo] [repo] After finishing the official quick start, I wanted to try Next.js out with an actual project. Soon after I started web programming, I used plain HTML and CSS (and a lot of ChatGPT) to put together a web version of John Selden’s Table Talk. The process took a day or two around new year’s eve and new year’s day. 8 months on and with Next, the process has got a lot smoother....

July 29, 2024

My first LLM agent

I was recently invited to try PromptBro’s LLM agent function. While I occasionally use Perplexity.ai for debugging, my exposure to LLM agents was limited to the very amusing Bertie Wooster bot on Poe. The sign-up experience is smooth. One of the first things I tried is the DALL-E integration, and I was impressed by the quality of the image generated. I entered the following text prompt. Give me a tutor who teaches a web dev (who is familiar with the usual tools) how to use the framework Next....

July 29, 2024

Next, Supabase, Mailgun

My aim is simple: on my deployed website, when a user enters her email to sign up for something, my website needs to send her a confirmation email, and also log it into a database. So, how to go about it? It is not hard to get a Next.js and Supabase working together on a local machine or when deployed. There is an official tutorial which is good but for a minor flaw....

July 29, 2024

Reflections on a typo

Much of my day was spent working on a bug described in this SO question. In a narrow sense, it was caused by a careless error: it was a hanging " in one of my environment variables. But in the broader sense, the problem wasn’t the typo. It is my unfamiliarity with Next.js, which made me look and double-check all these areas:- client/server components different .env file settings for each the concept of components itself Next directory structure mailgun create method Had I known the eco-system better, I wouldn’t have looked so widely: the typo would have been spotted sooner....

July 29, 2024

Learn Next.js (up to Ch.7)

As related earlier, two projects I am joining uses Next + Supabase, so I need to get up to speed with them. The official Learn Next tutorial felt quite heavy going at first. But now (at Ch.7) I feel it actually strikes quite a good balance between a simple “toy” example and something more substantial. There is quite a lot of pre-requisites. For example, without some familiarity of React, a lot of the materials won’t really make sense....

July 26, 2024

More Clojure

With these resources (in chronological order): Try Clojure Exercism Clojure track ClojureScript Koans up to /#functions/9 So as to return to 4clojure at my next Dojo!

July 26, 2024

Display rate limit in Official Next + Supabase Quick Start

I need to familiarise myself with Next + Supabase, so used this (generally) very engaging official tutorial to get me started. However, I quickly ran into a problem. The “Log in” page has two buttons: “Sign In” and “Sign Up”. Because the “Sign in” button is green, I clicked on it without much thought. But, with no signed up, no one can sign in. A sensible error message, “Could not authenticate user”, appears....

July 25, 2024