Skip to content

Instantly share code, notes, and snippets.

View erickpatrick's full-sized avatar
🎯
Focusing

Erick Patrick erickpatrick

🎯
Focusing
View GitHub Profile
@erickpatrick
erickpatrick / Homestead-Magento.yaml
Last active January 8, 2024 01:50
Laravel Homestead on Windows with SMB ("faster shared folders")
---
ip: "192.168.10.10"
memory: 4096
cpus: 2
provider: virtualbox
authorize: C:/Users/<your-user>/.ssh/id_rsa.pub
keys:
- C:/Users/<your-user>/.ssh/id_rsa
@erickpatrick
erickpatrick / making-xdebug-work-with-vagrant-phpstorm-vscode-laravel-homestead.md
Last active July 6, 2023 15:28
Making xdebug work with Vagrant, PHPStorm and Laravel Homestead on Windows

If you, like me, use a development machine provided by the company It department, it will probably be Windows based due security policies enforcement or something on these lines. That's ok, many of the new Windows based machines are really good and sturdy, and now, with the [Windows Subsystem for Linux] it can even work better for development that is not related to C#, .Net or related technologies.

The environment

However, when working with PHP and Laravel, we already have a nice way to run our code, inside the [Vagrant] VM from Laravel itself, [Homestead]. It comes with a bunch of software preinstalled that

@erickpatrick
erickpatrick / install-vim-8-with-python-ruby-lua-ubuntu.sh
Last active April 19, 2023 09:32
Install Vim 8 with Python, Python 3, Ruby (2.5) and Lua support on Ubuntu
# remove current vim
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
# removes current link for vim
sudo rm -rf /usr/local/share/vim /usr/bin/vim
# add ppa for newest version of ruby (currently, as of 06/06/2017, ruby v2.4)
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
@erickpatrick
erickpatrick / init.vim
Last active January 10, 2023 18:42
Neovim CoC Intelephense configuration
" TODO: split up config into multiple files
" source $HOME/.config/nvim/vim-plug/plugins.vim
" source $HOME/.config/nvim/<category>/<sub-category-filename>.vim
" source $HOME/.config/nvim/<plug-config>/<plugin-name>.vim
set nocompatible
filetype off
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
@erickpatrick
erickpatrick / coc-phpcs.md
Created January 25, 2021 14:30
coc phpcs

instructions

  • Install phpcs as per their readme and add a phpcs.xml to the root of the project with your rules.
  • Install Coc-diagnostic (:CocInstall coc-diagnostic)

On you ~/.config/nvim/coc-settings.json

{
@erickpatrick
erickpatrick / .editorconfig
Created August 15, 2021 14:42
.editorconfig for vscode
[*.js]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
@erickpatrick
erickpatrick / .ctags
Last active June 3, 2021 22:08
~/.ctags for PHP
--recurse=yes
--exclude=.git
--exclude=vendor/*
--exclude=node_modules/*
--exclude=db/*
--exclude=log/*
--exclude="*/_*cache/*"
--exclude="*/_*logs{0,1}/*"
--exclude="*/_*data/*"
--fields=+laimS
@erickpatrick
erickpatrick / php-7-3-install-magento-ngnix.sh
Last active April 30, 2020 01:16
Install php7.3-magento-ngnix
PATH_TO_MAGENTO='/path/to/magento/installation/folder'
GITHUB_TOKEN='github-token-here'
MAGENTO_USER='your-key-here'
MAGENTO_PASS='your-pass-here'
MAGENTO_ADMIN_URL='http://your-server.com'
MAGENTO_ADMIN_USER='admin'
MAGENTO_ADMIN_PASS='admin123'
# ondrej best php apt-repository for php to be able to
# update and install PHP as needed
@erickpatrick
erickpatrick / changes-git-history.sh
Created October 25, 2019 20:37
renames user and changes email from git history
git filter-branch --env-filter '
OLD_EMAIL="erick.alvarenga@erickpatrick.net"
CORRECT_NAME="erick patrick"
CORRECT_EMAIL="github@erickpatrick.net"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
@erickpatrick
erickpatrick / undo-like-tweets.js
Last active August 16, 2019 07:12
Unlike all liked tweets I have
let likeToUndo = document.querySelectorAll('[data-testid=unlike]')
likeToUndo.forEach(node => {setTimeout(() => node.click(), 500)})