Cheshire Codes

2023 Year in Review: Favorite Programming Projects

Happy New Year! Looking back at 2023, I did a lot of programming projects but didn't keep up with this blog as I hoped. I thought now would be a good time to do a post looking at some of my favorite projects I did in 2023 that I haven't posted about yet.

In no particular order...

TUI Music Player in Golang

... Read more

Using the Function Call Feature of ChatGPT API in Node.js

I just finished prototyping a project that uses the ChatGPT API, and I used its function call feature to streamline my code. However, I didn't find much online about how to use this feature with the NodeJS openai library, so I thought I'd do a write up on that here.

The function call feature allows you to describe a function to ChatGPT, and get a JSON string in return with arguments which you can then use to call that function. Note that ChatGPT will not actually call the function itself as part of this API - instead it returns JSON which you need to then parse, validate, and then use to call the function yourself later in your code.

... Read more

Coding a Chaos Game Simulation to Generate Rainbow Fractals

The chaos game is a neat way of generating fractals with just a polygon and a point - and a smattering of random chance. To play the game, first you start with polygon and a random initial point somewhere inside of that polygon. Then:

  1. Pick a random vertex on the polygon.
  2. Draw a point that is some fraction of the way in between your random point and the vertex you picked.
... Read more