View .php_cs.php
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->exclude('somedir') | |
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php') | |
->in(__DIR__) | |
; | |
return PhpCsFixer\Config::create() | |
->setRules([ |
View .php_cs.php
<?php | |
use PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$rules = [ | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => [ | |
'default' => 'single_space', | |
'operators' => ['=>' => null] |
View brightoak.yml
name: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Tests |
View tunnel.sh
#!/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 $username@ssh.localhost.run |
View mac-provision.sh
#!/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 |
View .htaccess
# /wp-content/uploads/.htaccess | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule (.*) http://www.yourproductionserver.com/wp-content/uploads/$1 [L] |
View deleteEmptyFiles.php
<?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); |
View .bashrc
# 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' |
View wordpress_uploads.conf
# save this file to /etc/nginx/forge-conf/example.com/server/ | |
client_max_body_size 100m; |
View link_core_wp_files.sh
#Copy/paste this into the "Before This Action" hook of "Activate New Release" | |
cd {{release}} | |
# choose the directory dynamically in case of upgrade | |
wordPressDirectory=$(ls -d ../../../wordpress-*/ | tail -1) | |
ln -s ${wordPressDirectory}index.php . | |
ln -s ${wordPressDirectory}wp-activate.php . | |
ln -s ${wordPressDirectory}wp-admin/ . | |
ln -s ${wordPressDirectory}wp-blog-header.php . |
NewerOlder