Skip to content

Instantly share code, notes, and snippets.


Rory McDaniel rorymcdaniel

  • Frederick, MD
View GitHub Profile
rorymcdaniel / .php_cs.php
Last active Jul 2, 2020
PSR12 php-cs-fixer config
View .php_cs.php
$finder = PhpCsFixer\Finder::create()
return PhpCsFixer\Config::create()
View .php_cs.php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
rorymcdaniel / brightoak.yml
Created Mar 26, 2020
Starter Github workflow file for Laravel projects
View brightoak.yml
name: CI
runs-on: ubuntu-latest
name: Tests
rorymcdaniel /
Created Jan 23, 2020
Parses information from current Lando container and creates a tunnel using
url=`lando info -s appserver_nginx | grep http://localhost`
[[ $url =~ $pattern ]]
username=`lando info | grep appserver\.\*\.internal -m 1 | grep -oP '(?<=[.])\w+(?=[.])'`
ssh -R 80:localhost:$port $
rorymcdaniel /
Last active Dec 19, 2019
Provision my mac after re-installing
# First, install Homebrew
/usr/bin/ruby -e "$(curl -fsSL"
brew install caskroom/cask/brew-cask 2> /dev/null
brew install node
brew cask install iterm2
rorymcdaniel / .htaccess
Created Jun 22, 2017
Pull Uploads from Production in WordPress staging environment
View .htaccess
# /wp-content/uploads/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)$1 [L]
View deleteEmptyFiles.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:
$directory = new RecursiveDirectoryIterator('./');
$iterator = new RecursiveIteratorIterator($directory);
rorymcdaniel / .bashrc
Created Apr 26, 2017
Sync a remote WordPress database with local
View .bashrc
# this assumes you have a WP CLI alias set up for your production environment already
# 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'
rorymcdaniel / wordpress_uploads.conf
Created Mar 14, 2017
Fix for http error on upload on WordPress on Nginx
View wordpress_uploads.conf
# save this file to /etc/nginx/forge-conf/
client_max_body_size 100m;
rorymcdaniel /
Created Mar 8, 2017
Deployment Script for Pagely VPS and Envoyer