Learning

Understand Service Containers and Service Providers

In the simplest terms, we could say that the service container in Laravel is a box that holds various components' bindings, and they are served as needed throughout the application.

In the words of the official Laravel documentation:

The Laravel service container is a powerful tool for managing class dependencies and performing dependency injection.

----------------------------------------------------------------

php artisan serve

php artisan optimize:clear
php artisan config:cache
php artisan view:clear
php artisan cache:clear
php artisan route:cache

composer dump-autoload

php composer.phar global update

npm install bootstrap
npm install bootstrap-icons

1. Create new project:

    #Via the installer
    laravel new links

Some of the facts related to Node.js which might catch your attention are as follows.
1. Node.js is built on top of the V8 JavaScript engine of chrome.

2. Node.js is a server framework which is available for free.
3. Node.js has a huge impact on the business around the world.

Source: https://nodejs.org/en/user-survey-report/

In this blog, I have tried to give a very brief information about the NodeJS frameworks so that it becomes easy for you to choose the framework for your future projects. I have also pointed out the most noteworthy decisive parameters for the reason that you dont get confused in making the right choice.

I hope you will like this blog. In case of any queries feel free to ask in the comments section and do share your thoughts about the blog.

------------------------------------

 

router.get("/async-await", async function(req, res){  

   try {

   const data = await pullData();

   const userData = await getUser(data);

   res.json(data);

   }catch(err) {

      console.error(err);

 

   }

});

 

function pullData () {

   return new Promise((resolve, reject) => {

     setTimeout(function () {

       console.log('Pull Data function done')

       resolve()

     }, 1000)

   })

 }

 

 function getUser () {

First, consider the following blocking code.

Synchronous code for reading from a file in Node.js

 

const fs = require('fs');

console.log('start');

const data = fs.readFileSync('./file.txt', 'utf-8'); // blocks here until file is read
console.log('data: ', data.trim());

console.log('end');

What’s the output of this program?

We are using Node’s readFileSync.

Sync = Synchronous = Blocking I/O model

Async = Asynchronous = Non-blocking I/O model

Step 1: Enable TLS on the server

 

To enable TLS on a server

To connect to a private RDS DB instance from a local machine using an EC2 instance as a jump server, follow these steps:

  1. Launch and configure your EC2 instance and configure the network setting of the instance.
  2. Configure the RDS DB instance's security groups.
  3. Connect to the RDS DB instance from your local machine.

Launch and configure the EC2 instance

A BLOB is a binary large object that can hold a variable amount of data. There are four types of BLOB –

  • TINYBLOB
  • BLOB
  • MEDIUMBLOB and
  • LONGBLOB

They all differ only in the maximum length of the values they can hold.

A TEXT is a case-insensitive BLOB. The four TEXT types

  • TINYTEXT
  • TEXT
  • MEDIUMTEXT and
  • LONGTEXT

They all correspond to the four BLOB types and have the same maximum lengths and storage requirements.

LIKE and REGEXP operators are used to express with ^ and %.

1

2

SELECT * FROM employee WHERE emp_name REGEXP "^b";

SELECT * FROM employee WHERE emp_name LIKE "%b";

 

Pages