Hi there 馃憢

Welcome to my blog

Automating dotfiles configuration syncing with symbolic link

An attempt to use symlink to solve file syncing problem I鈥檓 a Neovim user. I maintain my Neovim configuration under ~/.config/nvim, as this is the default location where Neovim looks for its configuration files. However, I also store these configuration files (potentially with other configuration files like ~.zshrc) in a Git repository under ~/dotfiles/ (i.e. ~/dotfiles/nvim for Neovim config) for version control and syncing with GitHub. The challenge is that I鈥檝e been manually copying changes between those two directories, which quickly becomes tedious....

September 21, 2024 路 2 min 路 290 words 路 Papattarada A. (Pun Pun)

Interesting Linux stuff

Documenting interesting stuff I learn about Linux/Unix Configure alias Alias can be configured through alias <AN_ALIAS>=<THE_ACTUAL_COMMAND> Example: alias k=kubectl note that this only configures alias for the current shell session. To permanently configure an alias do: echo "alias k='kubectl'" >> ~/.zshrc Use alias to view all alias set Locate files/directories Files/directories could be located through: locate <FILE_NAME> Example: locate hello_world.txt note that locate depends on the database /var/db/locate.database which has to be initialized through: sudo launchctl load -w /System/Library/LaunchDaemons/com....

September 1, 2024 路 1 min 路 207 words 路 Papattarada A. (Pun Pun)

Understanding Spring Dependency Injection with @Autowired: Field, Constructor, and Setter Injection

Spring Framework is renowned for its robust Dependency Injection (DI) capabilities, which simplifies the management of dependencies and its lifecycle of beans in a Java application. This article delves into how to use @Autowired for field, constructor, and setter injection methods in Spring, and how these methods compare to traditional Java dependency management. What is Dependency Injection? Dependency injection is a design pattern that allows an object to receive its dependencies from an external source rather than creating them internally....

July 30, 2024 路 5 min 路 939 words 路 Papattarada A. (Pun Pun)

Java: `protected` vs `package-private`

TL;DR - The protected access modifier provides a level of access that is broader than package-private (i.e. Java default access modifier) but more restricted than public. protected: accessible from classes within the same package and subclasses (i.e. inherited) package-private: accessible from classes within the same package Example to illustrate protected access CodeCreator.java package com.example.cc; abstract class CodeCreator { // Protected abstract method protected abstract void createCode(); // Protected concrete method protected void startCreating() { System....

July 22, 2024 路 2 min 路 400 words 路 Papattarada A. (Pun Pun)