The best programming blog.

Covering a wide array of programming topics.

Pages to exclude in robots.txt for WordPress site

You can use the “Disallow” tag in the robots.txt file for the pages to exclude in robots.txt for WordPress site. The “Disallow” tag in a robots.txt file is used to prevent search engines from crawling or indexing certain pages of your website, including sensitive information or duplicate content. The robots.txt file can be a helpful…More

Understanding and Configuring the robots.txt File for WordPress Websites

Robots.txt is a file that tells search engine robots which pages or sections of your website should not be crawled. When a robot visits your website, it first looks for a file called robots.txt before it starts crawling your website. When you install WordPress, a file called robots.txt is created in the root directory of…More

Set status: subscribed via mailchimp api

To change a subscriber’s “status” to “subscribed” using the Mailchimp API, send a PATCH request to the lists/list id/members/{subscriber_hash} endpoint, where the list id is the ID of the list to be updated and the subscriber hash is the MD5 hash of the subscriber’s email address. The request body should include a JSON object with…More

Change inner html of div with angular directive

Angular directives allow you to add functionality to HTML elements. The most common use case for directives is adding behavior or functionality to an element without having to write any JavaScript code. In this case, we want to change the content inside our div element when it’s clicked on by the user. The ng-template directive…More

Angular directive to change background color of an element

Here is an illustration of a special directive that alters an element’s background color when the mouse hovers over it: Use the @Directive decorator to declare the directive’s selector in a new file that you create for it. Take the terminal to the folder where you want to add the directive. Use the following command…More

Angular basic example for implementing a directive

Directives are used in Angular to extend the capabilities of HTML elements and components. They are a method of adding behavior to DOM elements. Directives can be used to change the appearance or layout of elements, respond to user events, perform data binding, and do other things Here’s a simple example of how to use…More

Understanding @FocusState in SwiftUI

SwiftUI uses the @FocusState property wrapper to keep track of a view’s focus state. The active view is the one that gets keyboard input and other focus-related events when a view is focused. Here is an illustration of how you could modify the appearance of a view depending on whether it is focused or not…More

Find out graphics card and processor on MacBook Pro

There are several techniques to find out graphics card and processor on MacBook Pro, including: Using System Information Select Apple () menu from the top left of your MAC and search for the About option. Below is the screenshot for the About option: Click on the “System Report” button. You can found at the bottom…More