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
DELETE cce , cceda , ccede , ccei , ccet , ccev FROM catalog_category_entity cce | |
LEFT JOIN | |
catalog_category_entity_datetime AS cceda ON cce.entity_id = cceda.entity_id | |
LEFT JOIN | |
catalog_category_entity_decimal AS ccede ON cce.entity_id = ccede.entity_id | |
LEFT JOIN | |
catalog_category_entity_int AS ccei ON cce.entity_id = ccei.entity_id | |
LEFT JOIN | |
catalog_category_entity_text AS ccet ON cce.entity_id = ccet.entity_id | |
LEFT JOIN |
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 | |
# ==================================================================================================== | |
# The script below allows to have a quick overview of contributions on a Git repository. Bash 4+ is required. | |
# Especially useful when we do not have access to graphs like those that we can find on Github. | |
# | |
# This script handles three non-mandatory parameters: | |
# - START is used to keep commits only since the given date (default = 01 Jan 2000). | |
# - END is used to keep commits only until the given date (default = 01 Jan 2050). | |
# - MINIMUM is used to define the minimum number of commits in order to appear in the report (default = 10). |
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
<!DOCTYPE html> | |
<head> | |
<script type='text/javascript'> | |
window.onload = function () { | |
var video = document.getElementById('videoId'); | |
var canvas = document.getElementById('canvasId'); | |
var img = document.getElementById('imgId'); | |
video.addEventListener('play', function () { | |
canvas.style.display = 'none'; |
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
{ | |
"Change": { | |
"Application": { | |
"development-mode": true | |
}, | |
"Cache": { | |
"block": false, | |
"page": false | |
}, | |
"Db": { |
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 | |
BEHAVIOR="${1}" | |
if [[ "${BEHAVIOR}" != "bootstrap" && "${BEHAVIOR}" != "update" && "${BEHAVIOR}" != "reindex" ]]; then | |
echo "$(tput setaf 1)Please specify a valid behavior: $(tput bold && tput setaf 1)bootstrap$(tput sgr0 && tput setaf 1) or $(tput bold && tput setaf 1)update$(tput sgr0 && tput setaf 1) or $(tput bold && tput setaf 1)reindex$(tput sgr0 && tput setaf 1).$(tput sgr0)" | |
exit 1 | |
fi | |
if [[ "${2}" =~ "/" ]]; then | |
GROUP_NAME=$(echo "${2}" | cut -f1 -d/) |
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
/* | |
In the code below, "form_validation" is a JavaScript function provided by a third-party component. This function validates | |
and then sends the form values. Since these two behaviors are linked, it's impossible to only validate the form in this state. | |
But we can update the function without overwriting the whole code. | |
*/ | |
if (typeof form_validation === 'function') { | |
var definition = form_validation.toString() | |
.replace(/myForm\.submit\(\);?/, 'return true;'); |
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
server { | |
listen 80; | |
server_name magento1.dev; | |
root /var/www/html/magento1; | |
location / { | |
index index.php; | |
try_files $uri @rewriteapp; | |
} |
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
tests: | |
Pages should be fast enough: | |
path: "/.*" | |
assertions: | |
- "main.wall_time < 3s" | |
- "main.io < 1s" | |
- "main.cpu_time < 2s" | |
Pages should not consume too much memory: | |
path: "/.*" |
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
# Extract MySQL data | |
docker run --rm --volumes-from XXXXX -v $(pwd):/backup busybox sh -c "tar cvf /backup/backup.tar /var/lib/mysql" | |
# Restore MySQL data | |
docker run --rm --volumes-from XXXXX -v $(pwd):/backup busybox sh -c "tar xvf /backup/backup.tar var/lib/mysql/" |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
# ====================================================================================================================== | |
# Custom implementation of a garbage collector for Docker images, containers and volumes. | |
# | |
# Usage: | |
# bash docker-gc.sh | |
# | |
# In order to clean Docker volumes, the argument "-v" must be provided to the script. |
OlderNewer