Journals for

2022-09-30

🔗

Started up Warp Terminal once again to check out the latest updated. The various displays in Neovim all look correct now, which is great. And the notifications on finishing of long-running commands is welcome, since I'm frequently running long tasks in other tabs at work.

They've also added a quick session switcher (Cmd+Shift+P). Still would be nice to be able to switch between entire sets of tabs, like tmux lets you do, but I'm ready to give it another serious try.

2022-09-29

🔗

Finding more and more export cases in export-logseq-notes that I can replace with the new scripting functionality. I should have made this change ages ago.

Links

  • Not for the faint of heart, David Tolnay's Rust Quiz is a compilation of really tricky Rust questions, the kind of code that you probably should never write yourself but can be fun to puzzle through. Thankfully, the solutions explain things very well!

2022-09-28

🔗

One really nice thing about Just is that you can embed scripts directly into the justfile. Obviously larger scripts should still be separate files, but for scripts just a few lines long, it's really nice to have that flexibility and not have to create a separate file.

2022-09-27

🔗

I'm reconsidering the design goals for Ergo right now. Last I left it, I had the Javascript task runner working, but was confronted with the fact that developing code inside a web UI isn't great unless you have the full development resources of repl.it or similar.

So instead, the new plan is to focus more on the "state machine with some Javascript" use case, where each state can perform actions that run external commands or docker containers. (And maybe locally-hosted WASM if the network access story has been figured out, but given all the recent WASI drama, maybe not yet.)

The main advantage here is that the complex code development can be done with real tools. But it also opens up other possibilities, such as writing the code in other languages and using tools like SQLite for persistent data.

Hopefully with this change in design goals I'll be able to get unstuck on the project and get it going again.

Links

  • Just is a lightweight, but flexible, task runner. We installed this in our monorepo at work today. The low friction to automate common tasks and the ability to access them all through a single command are already making things easier.

2022-09-26

🔗

Almost finishing up the "journal" updates for the website, I added a monthly navigation sidebar. Will merge the PR once there's more than a single month to show. The final piece will be to add per-tag navigation to the same sidebar.

I've been really happy with the new SvelteKit changes from the past couple of months. The seamless integration of types between the frontend and backend and the easy ability to write server-only load functions specific to a page really make for a great development experience.

Links

2022-09-25

🔗

Today I Improved the tag management in export-logseq-notes, and added an auto-tagging feature which I'll use to generate tags for these journal entries.

Links

2022-09-24

🔗

Finished this iteration of the blog update. With the new SvelteKit version I had to update my janky method of getting the social card generator WASM and fonts into the Vercel deploy. Wasn't too bad overall though. The main trick is to read files from the working directory when in Vercel, and otherwise read from whereever the files are on your local computer.

const dirname = process.env.VERCEL
  ? process.cwd()
  : path.dirname(fileURLToPath(import.meta.url));

fs.readFileSync(path.join(dirname, 'font.ttf'));

Then finally, update your build command to not only run vite build, but also copy the files into the Vercel output:

vite build && \
  cp ./src/lib/og-image/*.ttf \
     ./.vercel/output/functions/render.func/

Not pretty and rather fragile, but it works for now.

Now that I have this "journal" functionality, next up will be some automatic tagging and an index sidebar for the journals. But at least it's finished enough now that I have a low-friction writing process for short stuff, since I haven't done any real writing in almost a year.

2022-09-23

🔗

Today I did most of the work to integrate the rhai scripting language into my Logseq exporter. This let me replace an increasingly-complex config file with a much more flexible script, which now is driving both the notes section and this section of the site.

Links

2022-09-22

🔗

Links

  • Whisper is a new release from OpenAI designed voice-to-text. Open source and with models available to download so you can run it yourself. I've already heard really good things about the transcription quality from this one.

2022-09-21

🔗

Reminder of the day: Run all tests before merging, not just unit tests. Even if your change is just to fix a unit test.

Links

  • LiteFS is a user-space file system implementation designed to sit between SQLite and the actual file system. It facilitates shipping SQLite transactions to other LiteFS nodes, which allows running SQLite in a multi-node setup. Beta software right now but this is looking very interesting.
  • repl.it wrote a blog post about production use of their own GPT-style large language models, with a glimpse into some of the tricks and techniques they use to make it a good experience for the users and a cost-effective operation for themselves.

2022-09-20

🔗

Got a spam text today addressed to a group of people, and the larger disruption than the initial text itself was everyone else angry and replying to the "sender." When of course the sender of the text was the only party not seeing it, since it was just a computer program. Oh well :)

Learning

Typescript Const Assertions

I keep forgetting this, so writing it down here. Typescript's const assertion declarations are helpful for telling Typescript that you aren't going to mutate an object and so it can more narrowly type the object.

// Typed as ['a', 'b'] instead of string[];
const values = ['a', 'b'] as const;
// Typed as [number, number] instead of number[];
const nums = [1, 2] as const;

This especially comes in handy when the values need to match up to keys in an object or you have a function argument of type [number, number] to ensure a certain array length.

Links