Essays, poems, and personal reflections from the desk and drawer.

notes

The Simplest way to load CSS asynchronously

27 August 2023

Sometimes we want to load the CSS asynchronously to reduce the intial page load and you can do the same by adding media="print" onload="this.media='all' to the link as below.

<link rel="stylesheet" href="/path/to/my.css" media="print" onload="this.media='all'">

Let’s dive into the details of the above:

  • The link’s media attribute is set to print.
  • print is a media type that applies to print-based media or when the user tries to print the page.
  • By using media="print", the CSS file loads asynchronously (since it’s not needed immediately for screen display).
  • However, we still want to apply the styles to the page for screen use.
  • To achieve this, we can use the onload attribute to change the link’s media to all once it finishes loading.
References

filamentgroup

essay

Codbix No.5

31 July 2023

Welcome to Issue #5 of The Codbix! This week: Learn how to build tools, Things we Wished More Developers Knew About Databases, and The Italian Town That Built Its Own Sun.

essay

What is React?

11 July 2023

React is an open-source front-end JavaScript library that is used for building user interfaces...

notes

PL/SQL Returning Into

10 July 2023

The RETURNING INTO clause allows us to return column values for rows affected by DML statements. The returned data could be a single column, multiple columns or expressions.

INSERT INTO t1 VALUES (t1_seq.nextval, 'FOUR')
RETURNING id INTO l_id;
References

Oracle, dba-oracle, oracle base

essay

Commenting the stored procedures

5 July 2023

Writings comments in the code will help you and anyone who reads the code by giving more readability and understandings...

notes

Deleting node modules

5 July 2023

In windows, deleting node modules takes so much time and sometimes it makes my screen unresponsive. I googled for some solution and found the below:

Install a npm package called npkill with the command npm i -g npkill.
After installing from the terminal go to the directory from which we want to delete the node modules and type npkill.

The command prompt will list all the node modules and we can select the required folder.
After the secltion, you can press the Space key which will erase the directory in which the cursor is located.

To exit, q, or Ctrl + c.

References

npkill

essay

Codbix No.4

30 June 2023

Welcome to Issue #4 of The Codbix! This week: Modern work requires attention, Self-healing code is the future of software development and How The world’s biggest batches of food are made.

essay

Data Dictionary Views in PL/SQL

21 June 2023

This is cheat sheet for data dictionary views in PL/SQL

essay

Redirect your webpage using JavaScript

14 June 2023

JavaScript to redirect from one website to another. The window.location object can be used to get the current page address and redirect to a new page.