This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "xDebug listen", | |
"type": "php", | |
"request": "launch", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Include any branches for which you wish to disable this script | |
if [ -z “$BRANCHES_TO_SKIP” ]; then | |
BRANCHES_TO_SKIP=(staging main) | |
fi | |
# Get the current branch name and check if it is excluded | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_EXCLUDED=$(printf “%s\n” “${BRANCHES_TO_SKIP[@]}” | grep -c “^$BRANCH_NAME$“) | |
# Trim it down to get the parts we’re interested in | |
TRIMMED=$(echo $BRANCH_NAME | sed -e ‘s:^\([^-]*-[^-]*\)-.*:\1:’ -e \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->exclude('somedir') | |
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php') | |
->in(__DIR__) | |
; | |
return PhpCsFixer\Config::create() | |
->setRules([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$rules = [ | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => [ | |
'default' => 'single_space', | |
'operators' => ['=>' => null] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
url=`lando info -s appserver_nginx | grep http://localhost` | |
pattern='([[:digit:]]{5})' | |
[[ $url =~ $pattern ]] | |
port=${BASH_REMATCH[1]} | |
username=`lando info | grep appserver\.\*\.internal -m 1 | grep -oP '(?<=[.])\w+(?=[.])'` | |
ssh -R 80:localhost:$port [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First, install Homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install caskroom/cask/brew-cask 2> /dev/null | |
brew install node | |
brew cask install iterm2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /wp-content/uploads/.htaccess | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule (.*) http://www.yourproductionserver.com/wp-content/uploads/$1 [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Recursively searches the current directory and deletes any file that has only an opening PHP tag and empty lines | |
* Thanks to Jan for providing the solution here: | |
* https://stackoverflow.com/questions/44185401/delete-file-containing-opening-php-tag-and-empty-lines | |
*/ | |
$directory = new RecursiveDirectoryIterator('./'); | |
$iterator = new RecursiveIteratorIterator($directory); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this assumes you have a WP CLI alias set up for your production environment already | |
# https://roots.io/leveraging-wp-cli-aliases-in-your-wordpress-development-workflow/ | |
# Just add this to your ~/.bashrc for unix or ~/.bash_profile for Mac | |
alias syncwpdb='wp @production db dump - > production.sql && wp db reset --yes && wp db import production.sql && rm production.sql' |
NewerOlder