Drizzle-SvelteKit Integration for Sqlite

In this post I’ll go over how to install Drizzle for sqlite on a SvelteKit project. This post is based on blog by sveltekit.io namely, Drizzle and SvelteKit Integration - The Ultimate Stack I’ve read through it and found that there are some parts which are not applicable for 2024. Also, the database they use is Postgresql which I feel is overkill for the majority of usecases. For this tutorial, I’ll be using Drizzle, with Turso integration. Turso is based on libSQL, which is a fork of SQLite. I.e. we’ll be using Drizzle with SQLite database. ...

June 11, 2024

How to Do Semantic Image Search On Your Laptop

This is how to do simple semantic search on low end hardware using free and open source software. We’ll be using clip.cpp’s image-search and CLIP models to do that. Before we begin, a quick explaination: CLIP is a neural network by OpenAI which maps text to images ggml is a file format for storing neural networks clip.cpp is a dependency-free implementaion of CLIP Now you know that, Let’s go! Semantic Search First, we’ll clone and build the clip.cpp repository ...

March 26, 2024

Tree-sitter Explained

For a long time now, I’ve wanted a syntax highlighter that would make my terminal highlighter (highlight) and text editor (neovim) agree on the color of the syntax highlight. So I came across tree-sitter, an external project that neovim uses to highlight stuff. I read a lot and found that many resources teach tree-sitter as only a neovim dependency and talk about neovim exclusively. I want this post to serve as a resource for non-neovim tree-sitter knowledge. ...

March 26, 2024

Search Engine and Chatbots

Recently, I learned about Perplexity, a new and trending AI search engine. It gives you both the natural conversation style chat, and the ‘referencability’ of a search engine. The company seems to be a startup and, I assume, trying to beat big companies in the search game, which is a tough feat, but not impossible. In playing with Perplexity a bit, I found that search engines and chatbots are entirely different beasts. ...

February 26, 2024

How Fantasy Name Generator Works

I used Fantasy Name Generators, a service which produces random character and fantasy names. I found that it was really fun producing random names and wanted to host it myself on my server. I saw that it wasn’t open source so I searched for similar open source projects. I found that most generators produced names of similar lengths. Most “random thing generator” uses a markov chains to produce text, which creates good names, but unlike other name generators, I find that FNG produces more natural ones. I was curious to know how it works, and why it produces such natural sounding names. ...

February 23, 2024

A codebase is always evolving

As someone who was once a beginner at coding, I tried to search for conventions and tricks to maintain my codebase. How big projects like the kernel or programming languages maintain their code. But those all ended in failure because I could not understand the code and their conventions. As I continued writing code, I began to learn that how a codebase is laid out is because of yes rules and conventions, but mostly because code changes. Like how you organize things in your own room. Someone else may try to understand why you put something somewhere, and there may be some logic to it, but it’s mostly a result of continuous changes; you have work to do so you move your stack of paper out of the way even though it’s in the wrong place, or you bought a new pencil case so you put it on your table for the time being. ...

December 11, 2023

How to Run a Chat Model Locally

I’ve been hearing more about running local chat bots, but everyone seems to talk about how to tweak one. I’ve yet to see somewhere people explain how to install one, so this is it. I’m gonna be using llama.cpp for the interface, and open_llama_3b for the model. Also, this tutorial will be limited to linux only. Prerequisites knowledge of linux, commands no need for a powerful GPU, (I myself am using an onboard graphics chip for this) ...

December 9, 2023

How to make astro website HTTPS

Generate certificate (cert.pem) and key (key.pem) openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname" Add https line in astro.config.mjs ... const cert = fs.readFileSync('./cert.pem'); const key = fs.readFileSync('./key.pem'); ... export default defineConfig({ ... vite: { server: { https: {key,cert} } } }); Sources StackOverflow Astro Git

November 14, 2023

Forcing People to Read

At school I was told books are very valuable and I should read a lot, then they shoved a math textbook at my face and told me to go on with it. I despised reading from then on, not reading books until I was told to. That was until my graduation, when the book-shoving stopped, and “just lectures, books are optional” began. That’s when my love for books blossomed. I don’t know if every book-lover’s experience is like this, but this is what I personally experienced. Books are valuable resources and should be experienced by all, but they shouldn’t be used to torture young adults with it. ...

August 20, 2023

My Opinion on X

The recent change from Twitter to X caused quite a lot of chaos. I was one of them who experienced this change first hand, and the first thought I had was “this is really stupid.” And I still think it is, here are some reasons why. It threw away all of Twitter’s identity and reputation. With the blue bird gone, the X is just a hollow character with no feelings. ...

August 19, 2023