Vertical Progress with steps – Only CSS & HTML

This is only CSS & HTML for creating vertical progress bar with steps.

This is not what I’ve done by myself. But I found this from the codepen. Below is the link for that.

https://codepen.io/erwinquita/pen/ZWzVRE

Credit: Erwin Quita https://codepen.io/erwinquita

Thanks Erwin Quita.

How to downgrade node version on Mac

Just follow the simple two commands and you will be able to downgrade node to it’s particular version.

Step-1: Install N by following command

npm install -g n

Step-2: After successful installation of N, run following command.

sudo n 14.15.0

Wait for the successful process and check version.

node -v
v14.15.0

And you are done!!!

How to update node on Mac

Just follow the simple two commands and you will be able to update node to it’s latest version.

Step-1: Install N by following command

npm install -g n

Step-2: After successful installation of N, run following command.

sudo n latest

Wait for the successful process and you are done!!!

How to add a protocol to URLs from WordPress post content

Sometimes you have URLs without http:// OR https:// into WordPress post content.

So you can use the following function for that. You can use this function for the_content filter for WP. And also you can use this anywhere in PHP code other than WP.

<?php
/**
* Fix the URLs from the content.
*
* This function will add protocol to URLs which has no protocol added.
*
* For example,
*
* google.com –> http://google.com
* https://google.com –> https://google.com
* http://google.com –> http://google.com
*
* @param string $content Content.
* @return string Content with fixed URLs.
*/
function fix_content_urls( $content = '' ) {
// Bail, if anything goes wrong.
if ( empty( $content ) ) {
return;
}
// Get all the links.
preg_match_all( '/<a[^>]+href=([\'"])(?<href>.+?)\1[^>]*>/i', $content, $result );
$search = $replace = array();
// Create search & replace array.
if ( isset( $result['href'] ) && ! empty( $result['href'] ) ) {
foreach ( $result['href'] as $url ) {
$parsed_url = parse_url( $url );
// If no protocol found, then add it for replacement.
if ( ! empty( $parsed_url ) && ! isset( $parsed_url['scheme'] ) ) {
$search[] = $url; // Original URL.
$replace[] = esc_url( $url ); // Fixed URL.
}
}
// Fix the URLs.
$content = str_replace( $search, $replace, $content );
// Freeup the variables.
unset( $search );
unset( $replace );
}
return $content;
}

Import large DB in MySQL using command in MAMP

Sometimes using phpmyadmin, it’s kind of impossible to import DB from the import section. So below is the command to import large DB into MySQL.

Step-1 Login to MySQL using following command

/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot

Step-2 Select DB in which you want to import DB

use DB_NAME;

Step-3 Import DB

SET autocommit=0 ; source PATH_TO_YOUR_SQL_FILE.sql ; COMMIT ;

That’s it.

Don’t forget to change path!!!