Skip to content

Instantly share code, notes, and snippets.

View TerrePorter's full-sized avatar

Terre Porter TerrePorter

  • Webpage Builders, Inc.
View GitHub Profile
@TerrePorter
TerrePorter / app.php
Last active July 15, 2024 23:55
Laravel: Giving a service provider load priority
<?php
/*
In the bootstrap/app.php file, add one of the following above the return statement.
*/
/*
Option 1, if you want to be ballsey and load before any service provider in the config/app.php file.
*/
$app->resolving(Illuminate\Foundation\Bootstrap\RegisterProviders::class, function () use ($app) {
class WP_Query_CustomSQL extends WP_Query
{
function get_posts() {
$posts = parent::get_posts();
// overwrite max_num_pages settings if set
$q = &$this->query_vars;
@TerrePorter
TerrePorter / gist:110facd34376b8ab171890a8bb247081
Created March 1, 2019 18:45
WordPress Custom page display listings of x per post type, maintaing x per page
<?php
// hack to over write the max_num_queries var
class WP_Query_CustomSQL extends WP_Query
{
function get_posts() {
$posts = parent::get_posts();
// overwrite max_num_pages settings if set
$q = &$this->query_vars;
@TerrePorter
TerrePorter / gist:b9b2d7f513dc4d0fe5632d6aa20485a3
Created January 3, 2019 14:43
vagrant plugin install json
vagrant plugin install json --debug
INFO global: Vagrant version: 2.2.2
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_DISABLE_PLUGIN_INIT="1"
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.2\\gems\\vagrant-2.2.2\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
@TerrePorter
TerrePorter / dump-without-die
Created January 8, 2016 21:01
Inline version of laravel dd, dump without die
<?php
if ( ! function_exists('ddd'))
{
/**
* Dump the passed variables and end the script.
*
* @param mixed
* @return void
*/
function ddd($v, $asString = false)