HTMX - Navigation Methods

When working with web applications, it’s common to navigate between different pages. It’s one of the basic parts of a web application. While using HTMX, it offers a few ways to achieve navigation between pages. Let’s explore them. hx-push-url attribute ( client ) This attribute is used to push a new URL to the browser’s history. This will change the URL without reloading the page. <a hx-get="/about" hx-push-url="true">About</a> or <a hx-get="/about" hx-push-url="/about-page">About</a> Hx-Push-Url header ( server ) We can also use Hx-Push-Url header to push a new URL to the browser’s history. This will change the URL without reloading the page. ...

HTMX - Trigger events from Server.

When using HTMX is a common pattern to write event based actions or ui updates in the client side. It’s a good practice to use javascript as event based scripting system in our client side code. Some events from the server might be required in client side to update the DOM or to trigger some actions. A common pattern to achieve this is to respond a header Server-Event with a value holding the custom event and then using javascript, you can handle the custom event. ...

Kubernetes - Overview

Kubernetes is an open-source platform designed to automate deploying, scaling, and operating application containers. It’s a very powerful tool which allows us to declare how the infra should look like and the kubernetes will make sure that the infra is in the desired state. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available. How Kubernetes Works Kubernetes uses a declarative model, allowing users to specify their desired state for the deployments and services they run. The Kubernetes Control Plane takes these declarations and works to ensure that the current state matches the desired state. If a pod crashes, the controller notices the discrepancy and starts a new pod to maintain the desired state. This model enables scalability and reliability for containerized applications. ...

Python - Overview

Python is an interpreted, high-level, and general-purpose programming language known for its readability and concise syntax. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. Python’s extensive standard library, dynamic typing, and dynamic binding options make it highly attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components. Few things I like about Python are Readability and Syntax: Python’s syntax is simple and clean. Extensive Standard Library: Python comes with a large standard library that includes modules for various tasks, such as connecting to web servers, reading JSON, and more. Few things I dislike about Python are ...

Kotlin - Overview

Kotlin is a modern, statically typed programming language that makes development faster and more enjoyable. It is widely used for Android app development, web development, and server-side development. Kotlin supports object-oriented and functional programming paradigms, making it versatile for various types of projects. It’s capability of DSL (Domain Specific Language) creation makes it more powerful. Few things I like about Kotlin are Extension functions and higher-order functions make the code more readable and maintainable. Kotlin’s null safety features reduce the risk of null pointer exceptions. Few things I dislike about Kotlin are ...

Rust - Overview

Rust is a systems programming language that prioritizes safety, speed, and concurrency without relying on a garbage collector. Its unique ownership model enforces memory safety and makes system-level programming more efficient. Rust is widely used in operating systems, game engines, and web applications for its performance and reliability, Also in some Web Clients using WASM. Few things I like about Rust are The ownership system, which ensures memory safety without a garbage collector. The powerful match statement for pattern matching and error handling. The zero-cost abstractions provided by traits and generics. Few things I dislike about Rust are ...

C# - Overview

C# (pronounced “C Sharp”) is a modern, object-oriented, and type-safe programming language developed by Microsoft. It is widely used for developing desktop applications, web services, and mobile apps. C# supports multiple programming paradigms, including imperative, declarative, functional, generic, object-oriented, and component-oriented programming. Few things I like about C# are It’s a simple and easy to learn language. The extensive standard library and ecosystem, including ASP.NET and .NET Core. Few things I dislike about C# are ...

Go - Overview

Golang, or Go, is a statically typed, compiled programming language designed for simplicity and efficiency. It is commonly used for backend systems, cloud services, and DevOps tools due to its robust standard library and support for concurrent programming. Go follows a procedural and concurrent programming paradigm, making it ideal for modern computing challenges. Few things I like about go are The seperation of data (struct) and behavior (methods). This makes the code more readable and maintainable. Easiness to write concurrent code. Go routines and channels are very easy to use and understand. Zero values instead of null. This makes the code more predictable and less error prone. Few things I dislike about go are ...

Servers - Configuration Management Overview

There are different ways to manage configuration of a server. A common pattern is to use a combination of multiple sources, such as env variables, config files, cli args etc… and overlapping values are resolved based priority of the source. eg: configuring a server with a port number. cli args ( --port=8080 ) env variable ( port=8080 ) config file ( port: 8080 ) default value ( 8080 ) The configuration management system should look up the values and apply the value at the highest priority source. ...

Hugo - Using a hugo theme

Hugo is a great static site generator. The build times are pretty fast and there are theme which we can use. A lot of Hugo apis are available to setup a static site which is like a blog / personal website / documentation. Here are some cool themes Hugoplate Papermod Setting up hugo Initialize a new hugo site hugo new site mysite --format=yaml Add a theme ( using papermod as an example ) cd mysite git init git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod Add the theme to the config file theme: "PaperMod" Adding content Any markdown files added in the folder content will be rendered as a page. Hugo follows route based on folder structure. ...