This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
env=$1 | |
if [ "$env" == "" ] | |
then | |
echo "env missing" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CURRENT_VERSION=$(ls -la | grep \ web | awk '{ print $11 }' | sed -e 's/phpMyAdmin-\(.*\)-all-languages/\1/') # ' | |
VERSION_CONTENT=$(curl -s https://www.phpmyadmin.net/home_page/version.json | php -r 'echo json_decode(file_get_contents("php://stdin"), true)["version"];') | |
LATEST_VERSION=$(echo "$VERSION_CONTENT" | head -n1) | |
LATEST_VERSION_DL_URL="https://files.phpmyadmin.net/phpMyAdmin/${LATEST_VERSION}/phpMyAdmin-${LATEST_VERSION}-all-languages.zip" | |
PHP_VERSION="php8.2" | |
if [ ! -f config.inc.php ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# php w mysql | |
# default: | |
# bcmath, bz2, calendar, cli, ctype, dom, fileinfo, filter, ipc, | |
# json, mbregex, mbstring, mhash, pcntl, pcre, pdo, pear, phar, posix, | |
# readline, sockets, tokenizer, xml, curl, openssl, zip | |
phpbrew install php-{version} +default +dbs +intl +soap | |
phpbrew ext install gd | |
phpbrew ext install iconv -- --with-iconv=/usr/local/opt/libiconv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "<?php" > rector_rule.php | |
echo "return [" >> rector_rule.php | |
for file in $(grep ^class_alias vendor/google/ -R | cut -d: -f1); | |
do | |
echo " '$(cat $file | grep ^class_alias | cut -d\' -f2)' => '$(cat $file | grep ^namespace | cut -d" " -f2 | cut -d\; -f1)\\$(cat $file | grep ^class\ | cut -d" " -f2)',"; | |
done >> rector_rule.php |