Back Home

Bookmarks / Today I Learned

Well, seems like you've found this not-so-secret page :)
This is where I keep my bookmarks or things that I learned. It's meant to be a public archive of things that I find interesting and useful whether it be an article, random thoughts, videos, literally anything. I hope you find something useful here too!

April 2025

(4 items)

Fix your types for LLM

TIL

When using agent mode to code, aka vibe coding, in the case of legacy code which has a fuck ton of type errors, you should fix them first, otherwise the LLM will stuck trying to fix the errors over and over wasting your tokens.

The better the type system is, the more efficient the LLM will be. So yeah, pay attention to the types! It will make them work more efficiently and hallucinate less because it knows the context.

Could also use graph memory or something but making your code typesafe is the better option overall, it benefits language server, humans, and the LLM — and it’s a lot easier!

Ask AI for commands

TIL

Recently trying out Nushell and I just made a function that asks AI for commands cuz brain too smol to came up with these commands. Code itself is pretty ez to understand so I ain’t gonna add any explanation.

It’s just standard openrouter request stuff.

def ai [instruction] {
  if ($instruction | is-empty) {
    return
  }

  let key = (pass show elianiva/openrouter | str trim)

  let body = {
    model: "deepseek/deepseek-chat-v3-0324:free",
    messages: [
      { role: "system", content: "You are a helpful assistant that turns natural language into Nushell commands on Linux. You can only provide command with no explanations, no quotation, just plain string." }
      { role: "user", content: $instruction }
    ]
  }

  print "Asking AI for command suggestion..."
  let response = (http post https://openrouter.ai/api/v1/chat/completions
    --content-type "application/json"
    --headers [Authorization $"Bearer ($key)" ]
    $body)

  let ai_command = $response.choices.0.message.content

  # trim newline cuz that's dangerous as fuck
  let sanitized = $ai_command | str trim

  commandline edit --insert $sanitized
}

Adding contents with Github issues

TIL

This idea was proposed by someone I know on Discord where you can just use Github issues to add contents to your blog. The way it works is quite simple, you basically create an issue, add a GHA workflow that will automatically convert that issue into a file and then commit it to the repo. Pretty neat!

This is the first post / test that I’ll be using, let’s see if it works. (sixth attempt :p)

How to consume creatine

TIL

I figured out that it’s a lot easier to just mix it with a little bit of water, stir it, and then drink it immediately. No need to add 200ml of water or something like that because this thing ain’t going nowhere, it’s not getting diluted anytime soon. Mixing it with protein shake is also a good way of consuming it.

The reason why is because when you use the unflavoured one, it feels like you’re consuming chalk. I should probably just buy the flavoured one next time. I thought it would tastes like nothing but no it tastes like chalk—not that I ever consumed chalk lol

August 2024

(1 items)

Design Systems Surf

Bookmark

A website that lists design systems by various companies. Contains a lot of useful demos and stuff.

July 2024

(2 items)

Privacy Guide

Bookmark

Resource for how to protect your privacy. Contains a lot of useful information and has a very good structure. Covers quite a lot of topics regarding protecting your privacy.

Toolfolio

Bookmark

A bunch of useful tools with various categories.

June 2024

(1 items)

Fix Fedora Deep Sleep

TIL

My deep sleep was not working when I closed the lid of my laptop since Fedora 40. It was caused by the mem_sleep mode set to s2idle instead of deep, no idea what changed it, but here’s the solution.

Check if the current mode is s2idle:

$ cat /sys/power/mem_sleep
[s2idle] deep

To change that to deep:

$ sudo sh -c 'echo deep > /sys/power/mem_sleep'

It should now be fixed:

$ cat /sys/power/mem_sleep
s2idle [deep]

Also, add the following to /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="mem_sleep_default=deep"

And update grub (you might need to adjust this command to your system):

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

March 2024

(5 items)

Bloom Filters (with Visualisations)

Bookmark

An introduction to Bloom Filters with visualisations. Bloom Filters isn’t quite an easy concept to grasp, so understanding how Hashing works is a good start.

Clean Code Summary

Bookmark

A short and concise summary of the Clean Code book by Robert C. Martin. It contains some of the most important principles and practices from the book.

Hashing (with Visualisations)

Bookmark

A basic introduction to hashing, with some visualisations to help understand the concepts. A great article to read and easy to grasp.

The Google SRE Book

Bookmark

A book about Site Reliability Engineering by Google. It covers several topics such as what is an SRE, what they do, and how they do it. It also covers the principles and practices of SRE.

Ruangguru Engineering Academy

Bookmark

Resource by Ruangguru for building a scalable web application. At the time of writing it looks pretty bland, but I’m sure it will be updated in the future.

February 2024

(8 items)

How to write Go HTTP service

Bookmark

A guide on how to write HTTP service using Go coming from someone with 13 years of experience. I think it’s a good one, even though I don’t really agree with some points, but that’s probably because I never encountered the issue that they had.

Go doesn't need Java-style GC

Bookmark

It covers some fundamental differences between Go and Java Garbage Collector and why Go doesn’t need Java-style GC because it doesn’t have the same problem that Java has.

Mastering Programming

Bookmark

A short and well written article listing some tips to becoming a better programmer. It’s written sort of like wisdoms in programming, if you will.

Book of Shaders

Bookmark

A very good resource to get started with shaders. It covers a bunch of stuff, although at the time of adding this, it doesn’t have a 3D section yet. Pretty much a book in form of a website.

Distributed System Reading List

Bookmark

A good reference if you’re looking for a list of resource to read regarding distributed systems. The author also added their own comments on each resource, which is a nice touch.

An Introduction to SQL for Wary Data Scientists

Bookmark

A good introduction to SQL for those who are new to it. It uses SQLite for the examples, but it should be universal enough that it can be used with any other SQL databases. It’s quite comprehensive and covers a lot of ground.

How to (seriously) read scientific papers

Bookmark

A great article on how to read scientific papers. It answers quite a few concerns that I had about reading scientific papers.

3D Game Shaders for Beginner

Bookmark

A bunch of tutorials on how to write shaders for 3D games. It covers quite a lot of different types of shaders, and it’s a great resource for anyone who wants to learn how to write shaders for 3D games.