How to install SVN with Homebrew on Mac M1

Step- 1. Installing Xcode’s Command Line Tools.

xcode-select --install

Step- 2. First you need to Installing and Setting Up Homebrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

The file you’ll modify depends on which shell you’re using. If you’re using Bash, you’ll use the file ~/.bash_profile:

nano ~/.bash_profile

However, if you’re using ZSH, you’ll open the file ~/.zshrc.

nano ~/.zshrc

Uncomment and change brew path with new path like: /opt/homebrew/bin.

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH

If you modified .bash_profile, execute this command:

source ~/.bash_profile

If you modified .zshrc, execute this command:

source ~/.zshrc

Now let’s verify that Homebrew is set up correctly. Execute this command:

brew doctor

Step- 3. Install subversion (svn) with brew. more info.

brew install subversion

Now let’s verify that SVN is set up correctly. Execute this command:

svn help

Main tutorial link: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-homebrew-on-macos

Thanks.

How to setup WPCS with Visual Studio Code on Mac

Step 1. Install Composer

Download composer binary file from getcomposer.org website by running the following command. It will create a composer.phar file in the current directory.

curl -sS https://getcomposer.org/installer | php

Now, copy this composer.phar file under bin directory to make available anywhere in the system. Also, set the execute permission on file. I have changed the filename from composer.phar to composer for the easy use.

sudo mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer

Run composer command on the command prompt. This will provide you composer version details along with options available with composer command.

composer

Upgrade PHP Composer

The PHP composer provides a command-line option (self-update) to upgrade itself. You can simply run below command from the terminal to upgrade compose on your macOS.

sudo composer self-update

more step: https://wpbeaches.com/set-up-composer-and-phpcodesniffer-on-visual-studio-code-on-macos/

How to Customizing iterm2 with ZSH and Powerline Fonts

  1. Download iTerm2 and install it.
  2. Install ZSH with terminal, ex: sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  3. Download Cobalt2 and drop the cobalt2.zsh-theme file in to the open ~/.oh-my-zsh/themes/ directory.
  4. Open up your ZSH preferences at open ~/.zshrc and change the theme variable to ZSH_THEME=cobalt2.
  5. Install Powerline and necessary fonts, one way is using PIP.

For first time PIP users you need to install PIP sudo easy_install pip

To install Powerline using pip

pip install --user powerline-status

Now install all necessary fonts by downloading or cloning git repository.

git clone https://github.com/powerline/fonts
cd fonts
./install.sh
  1. In iTerm2 access the Preferences pane on the Profiles tab.
  2. Under the Colors tab import the cobalt2.itermcolors file via the Load Presets drop-down.
  3. Under the Text tab change the font for each type (Regular and Non-ASCII) to ‘Inconsolata for Powerline‘. (Refer to the powerline-fonts repo for help on font installation.)
  4. Refresh ZSH by typing source ~/.zshrc on the command line.

How to Add The Total Active installations For Plugins Attached to a WordPress.org Username

function sp_total_active( $username = false, $args = array() ) {
	if ( $username ) {
		$params = array(
			'timeout'   => 10,
			'sslverify' => false
		);

		$raw = wp_remote_retrieve_body( wp_remote_get( 'http://wptally.com/api/' . $username, $params ) );
		$raw = json_decode( $raw, true );

		if ( array_key_exists( 'error', $raw ) ) {
			$data = array(
				'error' => $raw['error']
			);
		} else {
			$data = $raw;
		}
	} else {
		$data = array(
			'error' => __( 'No data found!', 'shapedplugin' )
		);
	}

	return apply_filters( 'sp_total_active', $data );
}

$total_active = sp_total_active('shapedplugin');


$plugin_names = array_values( $total_active['plugins'] );

$install = 0;
foreach ($plugin_names as &$plugin_name) {
    $install += $plugin_name['installs'];
    
}
echo esc_html($install);

 

How to Fix Missing ‘System Settings’ or ‘Settings’ in Ubuntu 20.04 LTS

Step 1: Right Click on the Desktop and Click ‘Open terminal‘.

You can also open Terminal by pressing Alt+Ctrl+t key on the keyboard.

Step 2: To install System Settings, type the command below in terminal:-

sudo apt install gnome-control-center

if it asks for your permission, press ‘Y’ key on the keyboard.

Step 3: To open the system settings, you can click on show Applications at the bottom left of your ubuntu and Type ‘settings’ in search box.

It’s Done