Skip to content

Instantly share code, notes, and snippets.

View phpbrew ext installs
# php w mysql
phpbrew install php-{version} +mysql
phpbrew ext install gd
phpbrew ext install iconv -- --with-iconv=/usr/local/opt/libiconv
phpbrew ext install zlib
phpbrew ext install json
phpbrew ext install ctype
phpbrew ext install imagick
phpbrew ext install filter
View Woocommerce number of all orders between dates
SET @prefix = 'wp_';
SET @date_from = '2020-01-01';
SET @date_to = '2020-12-31';
SET @query = CONCAT('SELECT sum(woim.meta_value) number_of_item_sold, woi.order_item_name
FROM ', @prefix, 'woocommerce_order_itemmeta as woim
LEFT JOIN ', @prefix, 'woocommerce_order_items as woi ON woi.order_item_id = woim.order_item_id
LEFT JOIN ', @prefix, 'posts as p ON woi.order_id = p.ID
WHERE woim.meta_key = \'_qty\'
AND p.post_status = \'wc-completed\'
@connorhu
connorhu / build
Last active Mar 9, 2021
symfony build and deploy
View build
#!/bin/bash
env=$1
if [ "$env" == "" ]
then
echo "env missing"
exit 1
fi