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
SELECT COUNT(id_order) AS nbOrder | |
, SUM(total_paid_tax_incl) AS 'CA_TTC' | |
, DATE(date_add) AS 'Date' | |
, payment | |
FROM ps_orders | |
WHERE YEAR(date_add) = 2017 | |
GROUP BY DATE(date_add), payment |
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
map $http_referer $bad_referer { | |
hostnames; | |
default 0; | |
# Put regexes for undesired referers here | |
"~site_a_bloquer.com" 1; | |
} |
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
# /etc/nginx/conf.d/default.conf | |
# NEED https://gist.github.com/Hotfirenet/0d5fc63204ecf8f0022294c0825ab408 | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
... | |
if ($bad_referer) { |
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
RewriteEngine on | |
#Regle a rajouter pas loin de RewriteEngine on | |
RewriteCond "%{HTTP_REFERER}" "site_a_bloquer.com" [NC] | |
RewriteRule \.(gif|GIF|jpg|JPG|bmp|BMP|jpeg|JPEG|png|PNG)$ http://hotfirenfw.cluster014.ovh.net/Je-suis-un-gros-encule.gif [L,R] |
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
SELECT A.reference, B.lastname, A.total_paid_tax_incl, A.date_add, C.name,D.* | |
FROM ps_orders A | |
INNER JOIN ps_customer B ON B.id_customer = A.id_customer | |
INNER JOIN ps_carrier C ON C.id_carrier = A.id_carrier | |
LEFT OUTER JOIN ps_socolissimo_delivery_info D ON D.id_cart = A.id_cart | |
WHERE A.date_add BETWEEN '2017-06-01' AND '2017-09-31' | |
# AND C.name IN ('Colissimo Suivi International','Colissimo Suivi Europe') | |
# AND A.total_paid_tax_incl <= 50 | |
# AND C.name <> 'Colissimo Suivi International' | |
# AND D.cecountry NOT IN ('AT', 'BE') |
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
git checkout develop | |
git pull origin develop | |
git checkout master | |
git merge develop | |
git push origin master |
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
UPDATE ps_affiliate A | |
INNER JOIN | |
( | |
SELECT id_order, SUM(product_quantity) AS nb_article_order | |
FROM ps_order_detail | |
GROUP BY id_order | |
) B | |
ON B.id_order = A.id_order | |
SET A.nb_article_order = B.nb_article_order |
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 | |
date=$(date +%y-%m-%d) | |
bckdir=REPLACE | |
keep_day=2 | |
container=REPLACE | |
docker exec -ti ${container} mysqldump --login-path=local --single-transaction --all-databases | gzip > "${bckdir}/${container}_${date}.sql.gz | |
find "${bckdir}"/* -mtime +${keep_day} -exec rm {} \; | |
exit 0 |
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 | |
rm -r ~/Library/Application Support | |
rm -r ~/Library/Caches | |
rm -r ~/Library/Google |
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
SELECT SUM(OD.product_quantity) AS 'OD.product_quantity', | |
OD.product_name, | |
C.firstname, | |
C.lastname, | |
C.email | |
FROM ps_order_detail OD | |
INNER JOIN ps_product P ON P.id_product = OD.product_id | |
LEFT OUTER JOIN ps_orders O ON O.id_order = OD.id_order | |
LEFT OUTER JOIN ps_customer C ON C.id_customer = O.id_customer | |
WHERE P.id_manufacturer = 216 |