Skip to content

Instantly share code, notes, and snippets.

View cagartner's full-sized avatar

Carlos Augusto Gartner cagartner

View GitHub Profile
@kayintveen
kayintveen / Magento2ValetDriver.php
Created February 5, 2017 13:10
Laravel Valet Magento 2 driver that helps me daily in installing local Magento 2 development locations with Nginx and Mysql. For more info about how to use this, checkout our blog where we wrote an article about it http://www.microdesign.nl/blog/
<?php
/**
* Laravel Valet Magento 2 Driver
* Originally written bysschlein
*
* Sligthly altered by:
* Kay in 't Veen - Microdesign B.V.
* http://www.microdesign.nl
*
@mtbottens
mtbottens / notreallyimportant.sh
Last active February 27, 2024 11:38
Easily update, import and sanitize magento2 cloud databases
function m2-update-database() {
# USAGE
# m2-update-database 'Magento Cloud Project Title' 'http://project.dev/'
# $1 = Project Title
# $2 = Local URL
# Get the project ID by the project title
PROJECT_ID=$(magento-cloud project:list --title=$1 --pipe)
GIT_BRANCH_NAME=$(git branch | grep \* | cut -d ' ' -f2)
@spinsch
spinsch / Magento1ValetDriver.php
Last active October 29, 2019 11:43
Laravel Valet Driver for Magento 1
<?php
/*
* Magento 1 Valet Driver
* @author spinsch
* @path ~/.valet/Drivers/Magento1ValetDriver.php
*/
class Magento1ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
@bgarrant
bgarrant / ValetSwitchPHP.md
Last active November 25, 2024 15:47
How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

Valet switch PHP version with these commands

Install PHP 5.6 and switch Valet to PHP 5.6

valet stop
brew unlink php71
brew install php56
brew install php56-mcrypt
@dannygsmith
dannygsmith / valet-plus-destroy
Last active July 18, 2023 09:07
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@butschster
butschster / debian-laravel.sh
Last active April 17, 2025 07:16
LEMP server configured for Laravel (MySQL, NGINX, php7.2-fpm, Redis, Websocket server, MongoDB, Composer)
# ================================================
# PHP 7.2
#
# See https://www.colinodell.com/blog/201711/installing-php-72
# ================================================
apt-get install -y apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
apt-get update
apt-get install -y php7.2-cli php7.2-gd php7.2-mbstring php7.2-curl php7.2-xml php7.2-zip
@rafaelstz
rafaelstz / 1step-Install-Deployer-Magento2-BitbucketPipelines.md
Last active September 12, 2024 22:05
Automated deploy using Magento 2 + Bitbucket Pipelines + Deployer

Use both files in your root folder and run:

curl -LO https://deployer.org/deployer.phar && sudo mv deployer.phar /usr/local/bin/dep && sudo chmod +x /usr/local/bin/dep
composer require deployer/recipes --dev
composer require rafaelstz/deployer-magento2 dev-master --dev
@shinesoftware
shinesoftware / fix-duplicates-product-entity-varchar.php
Last active August 20, 2021 14:10
Magento 2: Reindex Error - 1062 Duplicate entry `catalog_product_index_eav_temp` (?, ?, ?, ?, ?)...
<?php
$conn = mysqli_connect("HOST", "USER", "PASS", "DATABASE");
if (!$conn) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
#!/bin/bash
## get n98-magerun2
curl -o /usr/local/bin/magerun2 https://files.magerun.net/n98-magerun2.phar
## reset magento admin password
MAGE_NEW_ADMIN_PASS="$(head -c 500 /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&?=+_[]{}()<>-' | fold -w 15 | head -n 1)${RANDOM}"
read -e -p "---> Enter admin old login: " -i "admin" MAGE_OLD_ADMIN_NAME
@rafaelstz
rafaelstz / magedeploy.sh
Created May 12, 2020 21:35
Magento 2 Deploy script
#!/usr/bin/env bash
LANGUAGES="en_US pt_BR"
# production or developer
ENVIRONMENT="production"
COMPOSER=$(which composer)
PHP=$(which php)
ROOT=$(pwd)