Categories
Express.js

Express js upload and save base64 image into File System

Categories
Node JS

How to create a envelope in Docusign using Node Js

Categories
Node JS

How to SendGrid send email with node from terminal

In this post, I am gonna share code snippets which will trigger email along with file content to the given email address usign SendGrid and it will run on top of node js. Create a folder called emailTrigger and issue npm init –yes, it will create a file called packagejson file. Now install @sendgrid/mail library […]

Categories
Express.js

Azure CSP – Partner Center authentication with Node JS

In this post, I will show you Azure CSP partner center authentication with Node JS. We gonna use express JS as an application framework and the Request module to make HTTP calls to Azure REST APIs. Initiate the project with npm init –yes, it will create a file called package.json in the current folder. Now […]

Categories
Express.js

Send Email using SendGrid in Express.JS application

In this arti­cle, I will demon­strate a sim­ple exam­ple of send­ing emails using SendGrid in Express/ Node.js. Fortunately sending emails in express/node js pretty easy with SendGrid using @sendgrid/mail npm package. For sending HTML emails we are going to use template engine called pugjs, this project was formerly known as Jade. Create package.json file and […]

Categories
Laravel

How to create RESTful API in Laravel 5.7

In this tutorial, I will show you creating RESTful apis using Laravel 5.7 php framework. We gonna use the Laravel’s API resources to build RESTful APIs. Laravel’s API Resource class is a way to transform data from one format to another. For example, if you have a comment model and you want to manipulate the […]

Categories
Javascript

How to Remove Duplicates from JavaScript Array

You can use the JavaScript built in object Set to keep unique values of any type. You can make use of Set to remove duplicate entries from a JavaScript array. Here is how the code looks Set will only include distinct elements from that array, aka no duplicate. however, the Set doesn’t remove duplicates from […]

Categories
Express.js

Implement role based access control, JWT, Express.js , Node.js

In this post, We gonna build an access control layer using express-jwt-permissions for express based application. ACL will keep users from accessing information not meant for them. We gonna create the express.js application to role-based access control example. let’s create a folder called aclJWTExpress After creating, change the directory to aclJWTExpress Now initialize the project […]

Categories
Express.js

API Caching with Redis and Node.js

In this post, I would like to show you, how we can use Redis to Cache APIs response to avoid multiple hits to the API. Same technique you can use to avoid multiple database calls ..etc We gonna create the express.js application to demonstrate Redis cache example. let’s create a folder called redisCahceExample After creating, […]

Categories
React.js

How to fetch data from a remote API in React.js

In this post, I will show you fetching data from a remote source inside your React.js application. So let’s create a brand new React project with  Initialize a React project If you succeed in executing the above commands, you will see the default React page in the browser at http://localhost:3000. Now Let’s get into the […]

Categories
Unix/Linux

How to create an SSH shortcut

In this post, I would like to show you a quick way to SSH into VMs. Using this approach you don’t have to type  ssh -i ..etc every time.  Let’s open your ~/.ssh file and create a file called config and copy below shown text to it,  If you get Permission denied issues,  change the file permission […]

Categories
Slim Framework

How to deploy slim framework on CPanel

In this post, I would like to show you deploying your slim framework project to CPanel (without SSH access). In general, for CPanel, the web root directory will be  public_html directory.  Slim3 Framework Authorization with JWT (JSON Web Tokens)  So now move all the files from your slim project public directory to the public_html directory. […]

Categories
Laravel

How to get last inserted id in Laravel

In this post, I would like to show the different ways to get last inserted ID from the database table when working with Laravel PHP Framework. In the core PHP, we will get last inserted ID with mysqli_insert_id() or PDO::lastInsertId() methods, but in Laravel framework you don’t need have to use those methods. In the […]

Categories
PHP / MySQL

How to get Mysql Table Comments

Let’s assume that we have a table with the following table schema: Run below SQL query to see the employee table information: The output of the preceding command will look like below shown: Show table comments By using the following command you can see the comment of table The output of the preceding command will […]

Categories
PHP / MySQL

Merging PDFs using PHP and ghostscript

In this post, We will show you how you can use Ghostscript with PHP to merge multiple PDF files into single file. Using Ghostscript, it is possible to merge multiple PDF files into a single PDF file with a single command from your terminal or command line. Install Ghostscript Type the command sudo apt-get install […]