Posts

How to create Alias command in Linux or Ubuntu

Image
Create Alias Command in Linux or Ubuntu As a Linux user, you may come in a situation where you need to use the same command again and again. So typing the same command again and again will make it boring and sometimes it may happen that you will get distracted because of it. So you can create an alias for the command  to overcome this problem. Alias is like creating a custom or your own command, when you type your alias it will replace the actual command, Let's take example of Alias in Linux: As I am working on the MEAN application, mostly I need to run the frontend, backend, DB Services which is located in a different location so every time I need to type some commands to run the applications. To Run the frontend application I need to type the following command.  $  cd Documents/Work/myapp/frontend/  $ npm start   To Run the frontend application I need to type the following command. Syntax to create an alias in Linux:  $  alias aliasName="your command...

Flutter Hello world application

Image
Hello Developers, I have posted my previous post about flutter installation and basic difference, so today we will start the implementation of flutter. Flutter Hello World App To start with flutter web development, first of all, we will set up or VS Code IDE to make compatible with flutter development this isn't mandatory but this will help you for rapid development. Adding flutter extension to VS Code IDE Open VS Code Go to Extension by clicking below icon Now search for flutter you will get following list then click on install Now your extension is ready to use  Create a hello world app with CLI Run following command to create app with CLI $flutter create hello_world This will create a basic app for you. App structure will be as follows:   So over there will be a lib folder where we will invest time more to develop our application. If you see the main.dart file this will be our entry point for our application. You can remove the auto-generated file and write down the f...

Google Chrome remove redirect HTTP to HTTPS on localhost

Image
localhost:4200 Google Chrome remove redirect HTTP to HTTPS on localhost  If you are getting this kind of error while running on the local machine then following are the way to fix it. Hard Refresh You can check whether the current page is opening in incognito mode or not if it is opening in the incognito mode then the chances are Google Chrome has cached the site so whenever you are trying to reach the site then it redirecting to HTTP to HTTPS. Steps to follow: Open Google Chrome Developer Tools (Ctrl + Shift + i) Go to Network Tab Click on disabled cache checkbox at the top of the developer tools Now hard refresh the page (press f5 or shift refresh) This should work now Please find the following image to understand more about it. Please let me know if this help you. If you are still getting the same error then comment here we will try to help you.

macOS unrar file using terminal

Image
Hello Guys, Whenever you download some .rar file on your mac & you want to unzip/unrar it, macOS doesn't have a default unrar, so let's check how to do this. macOS unrar file using terminal Prerequisite: Homebrew installed on your macOS. Now we are ready to install the required software on our macOS, just run following command to install unrar tool. brew install unrar You can check whether its installed or not by running following command: $ unrar so it will print all available commands with it. now let's take an example you want to unrar file names MyApp.rar so following command will help you to unrar it. $ unrar x MyApp.rar It will create a new folder with MyApp name & also with all files & folders inside it. so this way it will unrar the file using the terminal.  I hope now can you can install & run above commands to unr...

JavaScript find max value in an array | find max value in array object

Image
Find the max or min value from an array or an object As JavaScript Developer we usually need to work on arrays & array objects and sometimes we need to do some operations on arrays like searching, sorting, find min/max etc. So today's post we will see how to find max or min value from an array. So let's take an example of the following array. let arr = [21,32,43,34,42,5,6,2,43,23]; If we want to find the maximum value from the array, so code will be as follows: Math.max(…arr); If we print it then the output will be as follows: So this will provide the maximum value from the array element. ProTip: If you are not aware of ... the operator then just inline explanation is that this is Destructuring mechanism for an array so it provides values in the destructed format. If we want to find the minimum value from the array, so code will be as follows: Math.min(…arr); So this will provide the minimum value from the array element. If we print it then the output will be as follows: ...

Install Python 3 on Mac

Image
Install Python 3 on Mac In this tutorial, we are going to install python3 in Mac OS. There are multiple ways to install like downloading from the official site  or homebrew . Check whether python2 installed or not Initially, MacOS came preinstalled with Python 2, however, starting with Mac 10.15 this is no longer the case. And since Python 2 will no longer be officially supported as of January 1, 2020, you  should really use Python 3 instead . Check whether python3 already installed or not: Before we start, make sure Python 3 isn’t already installed on your computer. Open up the command line via the Terminal application which is located at Applications -> Utilities -> Terminal. $ python --version Python version Xcode Installation: The first step for Python 3 is to put in Apple’s Xcode program which is important for iOS improvement as nicely as most programming tasks. We will use XCode to put in Homebrew. In your Terminal app,...

JavaScript check string contains in string or not using search() method

Image
JS find string contains in string If you want to check whether substring present or not in javascript then following are methods you can use: JavaScript Search() method to check whether the string contains substring is there or not const str = "this is main string to check" ; const subStr = "main string" ; if (str.search(subStr)) { console.log( ` ${ subStr } string is present in ${ str } ` ); } else { console.log( ` ${ subStr } string is not present in ${ str } ` ); } The Output will be as follows: Definition of Search() method The search() method searches a string for a specified value and returns the position of the match . Search()  method returns -1 if no match is found . We can search on a string or on a regular expression. It will return the first occurrence of the specified value. I will post more method in upcoming posts which I will link over there so you can check it. Thanks.