Skip to main content

Popular Posts

How to use terminal within the Sublime Text editor?

Sublime Text is primarily a text editor and does not have a built-in terminal like some other integrated development environments (IDEs) do. However, you can use the terminal from within Sublime Text by installing a package called Terminal and Terminus . To use the terminal in Sublime Text using Terminal package, follow these steps: Install Package Control (if you haven't already): Open Sublime Text. Press Ctrl + (backtick) to open the Sublime Text console. Copy and paste the installation code for Package Control from the official website: https://packagecontrol.io/installation Press Enter to execute the code. Wait for Package Control to install. Install the "Terminal" package: Press Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac) to open the command palette. Type "Package Control: Install Package" and select it from the command palette. In the package list, type "Terminal" and select the "Terminal" package to install it. Open t...

List of latest and most asked PHP practical interviews questions & answers

Core PHP Practical Interview Questions In this blog post I am sharing a list of some most asked PHP interview questions & answers. These are very useful and helpful for the freshers and experienced developer too. I have taken these questions from different sources and listed here at one place. Ques. How to reverse a string without using any builtin function? Ans: <?php $str = 'My name is Diwakar Kumar'; $len = 0; while(isset($str[$len]) != '') $len++; for($i = $len ; $i >= 0 ; $i--) { echo @$str[$i]; } Ques: Write a function to check if a given string is a palindrome or not. Ans: 1st Method: <?php function isPalindrome($str) { $str = strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $str)); // Convert to lowercase and remove non-alphanumeric characters $reverse = strrev($str); // Reverse the string return $str === $reverse; // Compare original and reversed string } 2nd Method: <?php funct...

How to delete multiple Git branches using pattern Matching

To delete multiple branches using Git with pattern matching, you can use a combination of Git commands and shell scripting. Here's an example of how you can achieve this:  1. Open a terminal or command prompt.  2. Navigate to your Git repository directory.  3. Use the following command to list all branches matching a specific pattern: git branch | grep "<pattern>" Replace <pattern> with the pattern you want to match. For example, if you want to delete all branches starting with "feature/" , you can use feature/* as the pattern.  This command lists all branches that match the specified pattern.  4. Review the branch names listed and make sure they are the ones you want to delete.  5. Once you're sure, you can use the following command to delete the branches: git branch | grep "<pattern>" | xargs git branch -D This command combines the previous `git branch` and `grep` commands to find the branches matching ...