Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Anton Roos anton-roos

🎯
Focusing
  • Britehouse Mobile
  • South Africa
View GitHub Profile
@anton-roos
anton-roos / latest-commit-by-branch.sh
Created Jun 10, 2020
Get all latest commits per branch sort by latest commit after git pull.
View latest-commit-by-branch.sh
git pull
echo "Git pull done, fetching timetable..."
for branch
in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch;
done | sort -r
@anton-roos
anton-roos / update-stock-status.sql
Created May 25, 2020
Update stock status of WooCommerce products.
View update-stock-status.sql
UPDATE wp_postmeta
SET `meta_value` = 'outofstock'
WHERE `meta_value` = 'instock'
AND `meta_key` = '_stock_status'
@anton-roos
anton-roos / select-products-no-featured-image.sql
Created May 25, 2020
Select WordPress Posts or WooCommerce Products with no featured image.
View select-products-no-featured-image.sql
@anton-roos
anton-roos / count-duplicate-skus.sql
Created May 25, 2020
Count duplicate WooCommerce Products SKUs
View count-duplicate-skus.sql
SELECT `meta_value`, `meta_key`, count(*)
FROM wp_postmeta WHERE meta_key LIKE '_sku'
GROUP BY `meta_value`
ORDER BY `count(*)` DESC
@anton-roos
anton-roos / select-duplicate-skus.sql
Last active May 25, 2020
Select duplicate SKUs from WooCommerce database.
View select-duplicate-skus.sql
SELECT meta_value
FROM wp_postmeta
WHERE meta_key = '_sku'
AND meta_value != ''
GROUP BY meta_value HAVING COUNT(meta_value) > 1
@anton-roos
anton-roos / update-sold-individually.sql
Last active May 25, 2020
Update Sold Individually of all WooCommerce products.
View update-sold-individually.sql
UPDATE `wp_postmeta`
SET `meta_value` = 'no'
WHERE `meta_key` = '_sold_individually'
@anton-roos
anton-roos / update-manage-stock.sql
Last active May 25, 2020
Updtate all WooCommerce Products to "Mange Stock"
View update-manage-stock.sql
UPDATE `wp_postmeta`
SET `meta_value` = 'yes'
WHERE `meta_key` = '_manage_stock'
@anton-roos
anton-roos / update-text.sql
Last active May 25, 2020
Update text in WooCommerce Database
View update-text.sql
UPDATE `wp_cf7dbplugin_submits`
SET `field_name` = REPLACE(`field_name`, 'tel-123', 'tel-576')
WHERE `field_name` LIKE 'tel-123%';
@anton-roos
anton-roos / footer.html
Last active May 25, 2020
Changing footer year with JavaScript Avada
View footer.html
@anton-roos
anton-roos / sendy.sql
Last active Apr 9, 2020
Sendy SQL Queries
View sendy.sql
/* Delete all bounced email addresses from list 13 */
DELETE FROM `subscribers` WHERE `bounced` = 1 AND `list` = 13;
/* Delete all marked as spam email addresses from list 5 */
DELETE FROM `subscribers` WHERE `complaint` = 1 AND `list` = 5;