Skip to content

Instantly share code, notes, and snippets.

View amandiobm's full-sized avatar

Amandio Magalhães amandiobm

View GitHub Profile
@amandiobm
amandiobm / readme.md
Created August 4, 2021 16:15 — forked from johnyvelho/readme.md
Installing Supervisor on Elastic Beanstalk - 2021 - Linux AMI 2 - Laravel Worker Setup
  • Create the following folder structure in your root project directory: .ebextensions/supervisor

  • Place the supervisor.config under .ebextensions/

  • Place the setup.sh under .ebextensions/supervisor/

  • Run "chmod +x .ebextensions/supervisor/setup.sh"

  • Place the supervisord.conf under .ebextensions/supervisor/

@amandiobm
amandiobm / mysql-docker.sh
Created March 1, 2021 07:59 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@amandiobm
amandiobm / laravel-password-reset.md
Created January 30, 2020 02:25 — forked from JohnnyWalkerDigital/laravel-password-reset.md
Laravel: Fix password reset (User email not sent)

Here's how to overcome this common gotcha: The default password reset system not working out of the box with Laravel 5.x (as you're not sent the user's password), without having to alter altering vendor/core. Here's how to make it work as you'd expect it to without changing any vendor files.

1. Create own notification

Firstly create a new notification for your app:

php artisan make:notification ResetPassword

Then open the newly created file: app\Notifications\ResetPassword.php and make the following changes:

@amandiobm
amandiobm / gist:ce31e6e03495deffa9b59f4b7b10d016
Created January 20, 2020 17:21
Delete local GIT branches that were deleted on remote repository
# https://medium.com/@kcmueller/delete-local-git-branches-that-were-deleted-on-remote-repository-b596b71b530c
`git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -d`
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
git fetch upstream
git checkout master
git merge upstream/master
git push
@amandiobm
amandiobm / gist:171d2073654244ae11e48a4473495f5f
Created December 16, 2019 23:03 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@amandiobm
amandiobm / Envoy.blade.php
Created December 4, 2019 07:07 — forked from kikoseijo/Envoy.blade.php
Laravel envoy template for Virtualmin & Webmin servers with cron jobs
@servers(['remote' => 'ks1.xxxxx.com', 'local' => '127.0.0.1'])
@include('vendor/autoload.php')
@setup
# customize this keys...
# USERNAME_HERE, DOMAIN_NAME_HERE, REPO_GROUP, REPO_NAME
$dotenv = Dotenv\Dotenv::create(__DIR__, '.env');
$dotenv->load();
@amandiobm
amandiobm / Revert-Gist.md
Created August 15, 2019 19:24 — forked from eduncan911/Revert-Gist.md
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone git@github.com:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.

@amandiobm
amandiobm / Readme.md
Created May 9, 2019 01:04 — forked from StefanieD/Readme.md
Install and use Supervisord with AWS Elastic Beanstalk, Symfony 2 and RabbitMq Bundle
  • Place the supervisord.conf under .ebextensions/supervisor/

  • Place the supervisor.config under .ebextensions/

  • Place the data_import_consumer.conf under .ebextensions/supervisor/

@amandiobm
amandiobm / xdebug-mac.md
Created January 10, 2019 23:40 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2018

🪲 Install and Configure xDebug on MacOS for PhpStorm 🐘

⚠️ This guide only applies to Homebrew v1.6+

  • Check your version brew --version before proceeding

  • Assuming that you have already installed php and apache via Homebrew v1.6+

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache