Skip to content

Instantly share code, notes, and snippets.

View nhovratov's full-sized avatar
😄
Hi there!

Nikita Hovratov nhovratov

😄
Hi there!
View GitHub Profile
@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

@deadlyhifi
deadlyhifi / related-products.php
Last active June 23, 2022 07:42
Have WooCommerce use only the subcategory a product is in for related products (not parent category)
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active March 15, 2024 12:53
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@noelboss
noelboss / git-deployment.md
Last active March 7, 2024 02:21
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@xperseguers
xperseguers / README.md
Last active March 23, 2024 18:21
Create composer patch from a pending TYPO3 patch on Gerrit

Following structure is expected for your TYPO3 project (adapt script if it differs):

.
├── composer.json
├── composer.lock
├── patches
│   ├── ...
│   └── ...
└── scripts
@ErHaWeb
ErHaWeb / README.md
Last active March 15, 2024 19:04
TYPO3 Auto-Installation Bash scripts to install and remove v10, v11, v12, v13 and dev

TYPO3 Auto-Installation

Since I need a TYPO3 test environment from time to time, I use these bash scripts for the automatic installation and removal of TYPO3. The installation script currently supports TYPO3 versions 10, 11, 12, 13 and dev.

Installation

I have stored the scripts under:

~/.shellscripts/typo3/

I use the following aliases: