A collection of tech essays and notes.
ESSAY

To PostgreSQL

8 May 2025
Earlier this week, I went to a seminar on Amazon AWS conducted by one of their partner organizations.
notes

Hide details in the mobile screen with Bootstrap

7 May 2025

In the feed page I need to hide the dotted line in the mobile screens. So here you can see how its can be done in Bootstrap.

  • d-none d-md-flex: shows only on md and up (desktop/tablet)

  • d-block d-md-none: shows only on mobile

  • text-nowrap: prevents text from wrapping

<div class="mb-3">
  <!-- Desktop layout -->
  <div class="d-none d-md-flex align-items-center">
    <a href="{{ .Permalink }}" class="text-decoration-none fw-medium me-2 text-nowrap">
      Sample heading
    </a>
    <div class="flex-grow-1 border-bottom dotted-line mx-2"></div>
    <p class="text-muted small text-nowrap mb-0">Date</p>
  </div>

  <!-- Mobile layout -->
  <div class="d-block d-md-none">
    <a href="{{ .Permalink }}" class="text-decoration-none fw-medium d-block mb-1">
      Sample heading
    </a>
    <p class="text-muted small mb-0">Date</p>
  </div>
</div>
notes

SQLite is the most deployed and most used database

6 May 2025

Avinash is sharing some cool facts about SQLite.

  • SQLite is the most deployed and most used database. There are over one trillion (1000000000000 or a million million) SQLite databases in active use.

  • SQLite is likely used more than all other database engines combined. Billions and billions of copies of SQLite exist in the wild. It’s everywhere.

These are mind blowing, have a look into that.

Article link

notes

To extract the value of a tag from an XML-like string in PL/SQL

12 January 2025

To extract the value of a tag from the given XML-like string in PL/SQL, you can use the EXTRACTVALUE function or XMLTABLE for XML processing.

Example Using EXTRACTVALUE

DECLARE
    xml_data CLOB := '<Status>200</Status><Message>Success</Message>';
    l_message VARCHAR2(50);
BEGIN
    -- Extract the FunctionalReferenceID value
    l_message := EXTRACTVALUE(XMLTYPE('<root>' || xml_data || '</root>'), '/root/Message');
    
    -- Print the value
    DBMS_OUTPUT.PUT_LINE('FunctionalReferenceID: ' || l_message);
END;

Example Using XMLTABLE

DECLARE
    xml_data CLOB := '<Status>200</Status><Message>Success</Message>';
    l_message VARCHAR2(50);
BEGIN
    -- Use XMLTABLE to extract the Message
    SELECT value
    INTO l_message
    FROM XMLTABLE(
        '/root/Message'
        PASSING XMLTYPE('<root>' || xml_data || '</root>')
        COLUMNS value VARCHAR2(50) PATH '.'
    );

    -- Print the value
    DBMS_OUTPUT.PUT_LINE('Message: ' || l_message);
END;

EXTRACTVALUE, XMLTABLE

ESSAY

Understanding Suspense

2 December 2024
React Suspense comes handy when you want to show an indication to user that something is loading in your app. Loader is the simplest example for a Suspense component. Let’s deep dive into the details of Suspense.
notes

Varchar datatype limits

30 November 2024

For NVARCHAR2 and VARCHAR2 maximum size is 4000 bytes, or 32767 bytes if the MAX_STRING_SIZE initialization parameter is set to EXTENDED. This is useful you have to allocate more data to a variable.

You can run the below command to view the parameter.

show parameter MAX_STRING_SIZE;
References

Oracle Doc, Max string size

ESSAY

Hosting your Hugo site on Netlify

23 November 2024
When I have built this website, I had checked for a free static host solution which is easy to use and maintain. After a little research I landed on Netlify...
ESSAY

Hugo image gallery shortcode

18 November 2024
Here’s a custom Hugo shortcode that creates an image gallery in a masonry style using GLightbox. This approach will display images from a specified folder in a masonry layout, and each image will open in a lightbox when clicked.
ESSAY

View posts grouped by month in Hugo

14 November 2024
A few months ago, I wrote a post on creating a feed page to list all posts on my Hugo website in a card format with pagination. Even though I am able to view the full posts...