Skip to content

Instantly share code, notes, and snippets.

@BronsonQuick
BronsonQuick / diff.sh
Created May 29, 2020
A gist that feeds diffs into a variable for precommit checks.
View diff.sh
# Determine modified and staged files.
JSSTAGED=$(git --no-pager diff --relative --name-only --cached --diff-filter=d -- '**/*.js' \
| xargs -L 1 printf "%s/%s\n" "$PWD")
PHPSTAGED=$(git --no-pager diff --relative --name-only --cached --diff-filter=d -- '**/*.php' \
| xargs -L 1 printf "%s/%s\n" "$PWD")
CSSSTAGED=$(git --no-pager diff --relative --name-only --cached --diff-filter=d -- '**/*.css' \
| xargs -L 1 printf "%s/%s\n" "$PWD")
SCSSSTAGED=$(git --no-pager diff --relative --name-only --cached --diff-filter=d -- '**/*.scss' \
| xargs -L 1 printf "%s/%s\n" "$PWD")
TSSTAGED=$(git --no-pager diff --relative --name-only --cached --diff-filter=d -- '**/*.ts' '**/*.tsx' \
@BronsonQuick
BronsonQuick / gist:4c7fd31b851da4fc28ea296f0eb95868
Last active Mar 22, 2018
A script to setup wpaustralia.org
View gist:4c7fd31b851da4fc28ea296f0eb95868
#!/usr/bin/env sh
set -e
HAS_GIT=`command -v git 2&>/dev/null || echo "false"`
HAS_BREW=`command -v brew 2&>/dev/null || echo "false"`
HAS_VAGRANT=`command -v vagrant 2&>/dev/null || echo "false"`
HAS_VIRTUALBOX=`command -v VirtualBox 2&>/dev/null || echo "false"`
RED=`tput setaf 1`
@BronsonQuick
BronsonQuick / config.local.yaml
Last active Mar 22, 2018
A Chassis config file for local development of wpaustralia.org
View config.local.yaml
# Chassis configuration
hosts:
- wpaustralia.local
# Extensions
#
# Install a list of extensions automatically
extensions:
- chassis/xdebug
- chassis/mailhog
View config.local.yaml
hosts:
- thunderhead.local
database:
name: wordpress
user: wordpress
password: vagrantpassword
prefix: thunderhead_
admin:
user: admin
email: admin@example.com
@BronsonQuick
BronsonQuick / lotsa_extensions.yaml
Last active May 7, 2020
All The Chassis extensions for testing updates.
View lotsa_extensions.yaml
extensions:
- chassis/tester
- chassis/mailhog
- chassis/xdebug
- chassis/nodejs
- chassis/fish
- chassis/gulp
- chassis/grunt
- chassis/imagick
- chassis/gmagick
View vm_ware.sh
chassis ⟩ vagrant up --provider=vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Fixed port collision for 22 => 2222. Now on port 2203.
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 172.16.138.166:22
default: SSH username: vagrant
View dem_queries.php
$taxonomies = Fusion()->get_content_taxonomies();
foreach ( $taxonomies as $taxonomy ) {
$tax_query['tax_query'][] = array(
'field' => 'term_id',
'terms' => $tags,
'taxonomy' => $taxonomy,
);
}
View gist:ebedaafafe5f2eb1cc0819069ae659c2
### Keybase proof
I hereby claim:
* I am BronsonQuick on github.
* I am bronsonquick (https://keybase.io/bronsonquick) on keybase.
* I have a public key whose fingerprint is 9697 FB93 A316 562E 7930 341E 7576 844C 8CBE AA39
To claim this, I am signing this object:
@BronsonQuick
BronsonQuick / gist:62589e4ea2b273e985a0
Created Mar 22, 2016
Better backtracing to fix dodgy themes and plugins. Pop this into mu-plugins
View gist:62589e4ea2b273e985a0
<?php
function sennza_backtrace() {
echo implode( '<br>', explode( ',', wp_debug_backtrace_summary( null, 4 ) ) );
};
add_action( 'deprecated_function_run', 'sennza_backtrace' );
add_action( 'deprecated_argument_run', 'sennza_backtrace' );
add_action( 'doing_it_wrong_run', 'sennza_backtrace' );
View wp-cli-batch-import.sh
# Activate the wordpress importer
wp plugin activate wordpress-importer --url=http://localhost/example.com/
# Iterate over all of the import files in a given folder.
for f in myfolder/*.xml; do wp import $f --authors=skip --skip=attachment --url=localhost/example.com/; done