Skip to content

111 Recipes

Dev notes for WordPress 5.8, 5.9, 6.0, 6.1

Published ·UPD ·In Documentation

How to merge two Git repositories

Published ·In Miscellaneous

Copied from an anwser on Stack Overflow

To merge project-1 into project-2:

$ cd path/to/project-2
$ git remote add project-1 /path/to/project-1
$ git fetch project-1 --tags
$ git merge --allow-unrelated-histories project-1/master
$ git remote remove project-1

How to target only HTML elements that have no CSS classes

Published ·UPD ·In Recipes

HTML elements without a class attribute or with an empty class attribute can be selected in CSS by using the negation pseudo-class and the attribute selector.

For example, to select paragraphs without classes:

p:not([class]),
p[class=""] {
  color: red;
}

The first selector in the group above selects all paragraphs without a class attribute. The second selects all paragraphs with an empty class attribute. Paragraphs with one or more classes are not affected and can be styled independently.

Documentation

WordPress Plugins

Published ·UPD ·In Resources

A list of WordPress plugins that I use often. The list is a work in progress.

Slugs for the ones available at the WordPress official repo:

admin-post-navigation classic-editor disable-comments disable-embeds disable-emojis omni-contact-form query-monitor relevanssi term-management-tools two-factor user-switching

How to delete (empty) the content of a file in Linux

Published ·UPD ·In Recipes
$ truncate -s 0 filename

What this command does: Truncates filename to a size of zero.

Documentation: manpages.debian.org/unstable/coreutils/truncate.1.en