How to merge two Git repositories
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
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
A list of WordPress plugins that I use often. The list is a work in progress.
- Admin Post Navigation
- Classic Editor
- Disable Comments
- Disable Embeds
- Disable Emojis
- GitHub Updater – Install and update plugins/themes hosted on GitHub, Bitbucket and more
- Omni Contact Form – @ GitHub
- Omni Control – @ GitHub – Collection of simple tweaks
- Query Monitor
- Relevanssi – Better search for small to medium-sized sites – Home
- Term Management Tools – Old but still works (Aug 2020)
- Two Factor – @ GitHub
- User Switching
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
$ truncate -s 0 filename
What this command does: Truncates filename to a size of zero.
Documentation: manpages.debian.org/unstable/coreutils/truncate.1.en