β†’ Conventional Commits ∞

Few days ago, I heard about this on some podcast (maybe changelog ? πŸ€·β€β™‚)

I have been using similar notation for my commits - even for this blog1 - but I did not know it is a specification.

The idea is that very first word of the commit message should indicate what sort of commit is it.

Most common ones are : fix, feat (To indicate bugfix and a feature)

Other useful ones are: docs, style, refactor, test

Then there is chore (catch all ? πŸ˜„)

I’ve used some of these at work as well.

As the website mentions, benefit of such style is that some tools can parse the git log to automatically generate the changelog.

Website also mentions, that

it’s not the end of the world if a commit lands that does not meet the Conventional Commits specification. It simply means that commit will be missed by tools that are based on the spec.


  1. Since the commits are just addition or updates to markdown files, most of the tags are not used here. I only use Add and occasional Update. I do believe it is in the spirit of conventional commits πŸ˜„ ↩︎

rust can Divide by Zero

At least for floating point numbers, it does not crash/panic! πŸ€·β€β™‚ fn main() { let x = 10.0; let y = 0.0; println!("{:?}", x/y); } This above code returns inf But if we change the number to int, compiler catches this 1 at shows the following error: error: this operation will panic at runtime This is a contrived example. Instead of static values, if these were passed at runtime, it would (should?

Continue Reading Β»

I got myself a new mobile phone after almost 5 years.

My old one is still going strong.

But there are no OS updates. I’m stuck at Android 10

Some random facts about the new phone - in no specific order

Since the phone is 5 years newer, it is better - by default - in so many categories.

I’m planning to put custom ROM on the older phone and give it to my kids, for occasional game or for web search for their studies etc.

We have a bicycle which was unused for months.

I got it fixed (some oiling, check tyres, brakes etc.) for all of Rs. 90 πŸ˜„

Today, I rode bicycle for the first time after decades.

Not for long. Maybe 15 minutes.

Since I was not used to it, my legs hurt πŸ˜„

But it felt great to ride a cycle after so many years.

Rust: Clone vs Copy

One of the strength of Rust is memory management. This also leads to compiler errors related to move or borrow When we assign an existing variable to new variable, two things can happen. Either the data is copied - in that case we can use both old and the new variable without worry. 1 Or data is moved - now we can only use the new variable, as the old variable is “out of scope”.

Continue Reading Β»

How to create IDE like experience in terminal using Zellij

(undocumented?) Zellij Keybindings Undocumented, because these don’t show up in the default configuration, which shows (I assume) most useful key bindings. I had to look for these, and found them in Github discussions/issues. Ctrl p d Ctrl p is for pane, but d after that (which I assume stands for down) is not documented. This creates a new terminal in horizontal split fashion 1 Ctrl n - to reduce the size of the terminal.

Continue Reading Β»

error: Unknown binary 'rust-analyzer'

As I am setting up my new machine, I came across this error when emacs tried to use rust-analyzer error: Unknown binary 'rust-analyzer' in official toolchain 'stable-x86_64-apple-darwin'. As mentioned in this SO question, which rust-analyzer did not show any error.1 Luckily, the same SO question also had the solution I needed to explicitly install it via rustup component add rust-analyzer Luckily, the comment in the accepted answer also explained why which works.

Continue Reading Β»

Format raw strings in rust

When refactoring code to make API call to Gemini, I learnt how to format raw strings in rust. fn main() { let var1 = "test1"; let formatted = format!(r#"var1 is: {}"#, var1); println!("{}", formatted); } This gives output as : var1 is: test1 If you want { in the output, then it needs to be escaped with additional { like: fn main() { let var1 = "test1"; let formatted = format!

Continue Reading Β»

How to use .env files with your rust project

It is very important that secrets are stored in environment variables during the runtime. During the development, it makes sense to use .env file. In my last project, there were probably 40+ variables in the .env. Although that project was in RoR the idea of .env itself is not new. But for me, using .env with rust is new. For my current (self) assignment, I needed to store an API Key.

Continue Reading Β»

Finally, my Macbook Pro is back!

As part of fixing, they put OS X Yosemite on it. 😭

Practically nothing worked. For some reason, Apple ID login also did not work. I checked on another machine, username/password was indeed correct.

There was no option to upgrade to macOS Monterey (last supported version on this hardware) from the App Store either.

App store listed macOS Sonoma, which I knew wasn’t supported, but tried it anyway. As expected, it said “Not supported” (Duh!)

Finally, resorted to Internet Discovery.

It offered to install macOS Monterey, as expected.

All is well.

(It took some time, downloading etc. But otherwise pretty uneventful)