Skip to content

Instantly share code, notes, and snippets.

View 4selin's full-sized avatar
🎯
Focusing

Alex 4selin

🎯
Focusing
View GitHub Profile
@4selin
4selin / pre-commit
Created October 3, 2020 11:27 — forked from fdemiramon/pre-commit
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@4selin
4selin / pagespeed-module.md
Created January 7, 2020 13:56 — forked from harryfinn/pagespeed-module.md
Pagespeed module (Apache) instructions

Using Google Pagespeed module (Apache)

Install

Follow initial install instructions here

Recommended additional modules

Add the following to the bottom (but inside the <IfModule /> block) of /etc/apache2/mods-available/pagespeed.conf

@4selin
4selin / db_copy.sh
Last active September 2, 2018 13:58
#!/bin/bash -v
#Remote
remote_user=
remote_ip=
remote_db=
remote_db_user=
remote_db_password=
#Local
@4selin
4selin / apache-vhost-vagrant.md
Created July 21, 2018 08:38 — forked from smotesko/apache-vhost-vagrant.md
Apache vhost reverse proxy for using Vagrant env on a localhost:80 (Mac)
  • Configure Vagrant box to forward guest port 80 to host port 8001
  • Add vhost to your Apache:
<VirtualHost *:80>
  ServerName projectname.local
  ProxyPass / http://localhost:8001/
  ProxyPassReverse / http://localhost:8001/
  ProxyPreserveHost On
</VirtualHost>
#PhpStorm
/.idea
#Vendor (e.g. Composer)
/vendor/
#Wordpress Core Files
index.php
license.txt
readme.html
@4selin
4selin / deploy.sh
Last active July 1, 2018 09:31
deploy bash script
#!/bin/bash -x
# -v verbose Print each command to stdout before executing it
# -x xtrace Similar to -v, but expands commands
#Remote User
user=_enter_user_
#Remote Group
group=www-data