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
{ | |
"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
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
#!/usr/bin/env bash | |
set -euo pipefail | |
# ====================================================================================================================== | |
# Make the SSH connection to EC2 instances easier by requiring only tag values instead of IP addresses. | |
# | |
# Usage: | |
# bash aws-connect.sh <environment> <bastion|apache|nginx|...> <index> | |
# | |
# Examples: |
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 | |
# ==================================================================================================== | |
# The script below allows to check automatically a commit message before saving it. | |
# In order to use it, you have to copy this code in .git/hooks/commit-msg inside your project. | |
# Don't forget to add proper permissions if you create a new file (chmod +x). Bash 3+ is required. | |
# ==================================================================================================== | |
COMMIT_MSG=$(cat $1) |
OlderNewer