Git : Revert back to Previous Revision

Revert back to Previous version in git

Required

  • Get the REVISIONNUMBER ( Revision number ) of the previous Revision which you want the files to revert back to.

Here is how you could revert back to previous Revision in git

  1. git reset --hard REVISIONNUMBER
  2. git push --force

Caution

This will delete all yours commits made between the REVISIONNUMBER and the CURRENT Revisionnumber

SSH : Change Owner of files and folders

Change Owner of All files within a Folder

Here is how to change Owner of Files and Folders in SSH as a Bulk

  • Login to SSH
  • Run
    chown -R user:usergroup /location/of/the/folder/*

Change Owner of one file

chown user:usergroup /location/of/the/folder/file-name.php

Find the list of files under a Owner

find /location/of/the/folder/ -user USERNAME

Featured Snippet Examples and Patterns

Featured Snippet Patterns:

1. Point based

  • Paragraph ending with :
    • "Here are the list of steps"
    • "Follow these steps"

HTML Tag : <p>

  • Followed by points

HTML Tags : <ul><li>, <ol><li>, <b>, <strong>

    • Other HTML patterns:
      • Series of <H3> under a <h2>
      • Series of <strong> under a <h2>
      • Series of <strong> Numbers under <h2> or <h3>
      • <ul><li><strong>Title 1</strong><p>Description</p></li><li><strong>Title 2....</ul>

2. Paragraph based

  • Followed by a H1, H2, H3 tag - HTML Tags : <h1>, <h2>, <h3>
  • Recommended Paragraph word count 42–58 words - HTML Tag : <p>

3. Table Based

  • Tag the table as <table>

Here are some examples of Featured Snippet:

1. Inbound Sales

Source : https://www.newbreedmarketing.com/blog/what-is-inbound-sales

2. How to use excel Shortcuts

 

3. how to set default browser and email

Source : https://blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht

4. How to set default browser email

Source : http://www.dummies.com/computers/pcs/how-to-set-default-browser-and-e-mail-programs-in-windows-7-and-vista/

5. How to make an animated GIF in Photoshop

Source : https://blog.hubspot.com/marketing/how-to-create-animated-gif-quick-tip-ht

6. How to write a press release

Source : https://www.procopywriters.co.uk/2015/09/how-to-write-an-effective-press-release/

7. How to write a press release examples

Source : http://www.ereleases.com/press-release-sample/

8. How to write a press release with examples

Source : http://www.cbsnews.com/news/how-to-write-a-press-release-with-examples/

Beginners Guide to LESS CSS Preprocessor

What is LESS?

Less is a CSS Preprocessor. http://lesscss.org/

Installing and Compiling

  1. Install Node.js https://nodejs.org/en/
  2. using npm ( Node Package Manager ) install LESS globally ( -g )
    1. $ npm install -g less
  3. Compile LESS

lessc style.less > style.css
  • lessc is used as the command for compiling

Error

'lessc' is not recognized as an internal or external command, operable program or batch file.


Solution for this Error

Compiling LESS

node C:\Folder\Name\node_modules\less\bin\lessc style.less > style.css

Note : \Folder\Name should be the folder in which the node_modules have been installed.

Beginners Guide to SASS CSS Preprocessor

What is SASS?

SASS is a CSS Preprocessor. http://sass-lang.com/

Installing and compiling

  1. Install Ruby https://rubyinstaller.org/
    • More Info : http://sass-lang.com/install
  2. Open Terminal or Command Prompt
gem install sass

Note : gems is a package manager for Ruby.

3. Check if sass got installed

sass -v

4. on a dedicated "test" folder , create two folders "scss" and "css"

C:\test

C:\test\scss

C:\test\css

5. In the Terminal or Command Prompt

C:\test>

Compile SASS

--watch command

--watch command is used to constantly monitor style.scss file for any changes and compile it as soon any change happens.

C:\test> sass --watch scss:css

sass --watch scss:css

--watch dedicated file

To watch dedicated file style.scss and style.css

sass --watch style.scss:style.css

style.scss is the main file

style.css is the complied file

Minify SASS

sass --watch scss:css --style compressed

Get all category ids in WordPress [Array]

Choose either one of these options to Get all category ids in WordPress as an Array

Get all category ids, Option 1

$output_categories = array();
$categories=get_categories($args);
 foreach($categories as $category) { 
 $output_categories[] = $category->cat_ID;
}

Get all category ids, Option 2

$categories_ids = get_terms(
 array( 'category' ), // Taxonomies
 array( 'fields' => 'ids' ) // Fields
);

$post Object Output in WordPress

WP_Post Object

WP_Post Object
 (
 [ID] =>
 [post_author] =>
 [post_date] =>
 [post_date_gmt] =>
 [post_content] =>
 [post_title] =>
 [post_excerpt] =>
 [post_status] =>
 [comment_status] =>
 [ping_status] =>
 [post_password] =>
 [post_name] =>
 [to_ping] =>
 [pinged] =>
 [post_modified] =>
 [post_modified_gmt] =>
 [post_content_filtered] =>
 [post_parent] =>
 [guid] =>
 [menu_order] =>
 [post_type] =>
 [post_mime_type] =>
 [comment_count] =>
 [filter] =>
 )