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 / 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)})
@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 / magento-aliases-functions.sh
Last active March 22, 2019 09:47
BASH function for daily work with Homestead+Magento2+Yarn+Webpack
function setup:recompile() {
cd ~/code
php bin/magento setup:upgrade
php bin/magento setup:di:compile
cd -
}
function setup:di:compile() {
cd ~/code
php bin/magento setup:di:compile
@erickpatrick
erickpatrick / xdebug-homestead-config.txt
Created January 17, 2018 15:12
Configuration for xDebug with Homestead
zend_extension=xdebug.so
xdebug.remote_autostart=1
xdebug.remote_host=10.0.2.2 // same as the one showed when vagrant ssh "last log in from"
xdebug.remote_enable = 1
xdebug.remote_log=/home/vagrant/output.txt
xdebug.remote_handler=dbgp
xdebug.collect_params=1
xdebug.show_local_vars=1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512
@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 / 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
export ZSH=/home/vagrant/.oh-my-zsh
ZSH_THEME="powerlevel9k/powerlevel9k"
export UPDATE_ZSH_DAYS=13
plugins=(git php composer ruby python git-flow node npm ubuntu svn sudo symfony2)
source $ZSH/oh-my-zsh.sh
export LANG=en_US.UTF-8
export EDITOR='vim'
export SSH_KEY_PATH="~/.ssh/rsa_id"
@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 / keybase.md
Created April 13, 2017 18:40
keybase.md

Keybase proof

I hereby claim:

  • I am erickpatrick on github.
  • I am erickpatrick (https://keybase.io/erickpatrick) on keybase.
  • I have a public key ASDyM7_SKpj9fQnIwKzu5EbO0UsM0udDThmNxEWrkbJpbwo

To claim this, I am signing this object:

@erickpatrick
erickpatrick / git-related-tutorials.md
Last active March 9, 2017 20:11
# Git related tutorials