Skip to content

Instantly share code, notes, and snippets.

View pcfreak30's full-sized avatar

Derrick Hammer pcfreak30

View GitHub Profile
@tylers-username
tylers-username / .env
Last active August 3, 2021 22:05
Install Blackfire on Lando & Automatically Configure
####
## Blackfire config - `lando rebuild` required
####
BLACKFIRE_CLIENT_ID=b5ee8ca3-****-****-****-5d227546a4c0
BLACKFIRE_CLIENT_TOKEN=3a2b88cbfb*******************************22763
BLACKFIRE_SERVER_ID=4b8ac335-****-****-****-b34439207732
BLACKFIRE_SERVER_TOKEN=98f7fdf4b12b7**************************12b837cf080d
@pcfreak30
pcfreak30 / alloptions.php
Last active December 13, 2018 01:02 — forked from lukecav/functions.php
Fix a race condition in alloptions caching in WordPress
<?php
/**
* Fix a race condition in alloptions caching
*
* See https://core.trac.wordpress.org/ticket/31245
*/
function _wpcom_vip_maybe_clear_alloptions_cache( $option ) {
if ( ! wp_installing() ) {
$alloptions = wp_load_alloptions(); //alloptions should be cached at this point
@bjornjohansen
bjornjohansen / wordpress-menu-cache.php
Last active March 7, 2024 13:57
WordPress Menu Cache
<?php
/**
* WordPress menu cache.
*
* @package BJ\Menu
* @author bjornjohansen
* @version 0.1.0
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2)
*/
@soderlind
soderlind / a_faster_load_textdomain.php
Created October 26, 2015 22:08
A faster load_textdomain for WordPress
<?php
/*
Plugin Name: A faster load_textdomain
Version: 0.0.1
Description: While we're wating for https://core.trac.wordpress.org/ticket/32052.
Author: Per Soderlind
Author URI: https://soderlind.no
Plugin URI: https://gist.github.com/soderlind/610a9b24dbf95a678c3e
License: GPL
@shamil
shamil / mount_qcow2.md
Last active April 18, 2024 07:32
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@jchristopher
jchristopher / gist:9331899
Last active September 9, 2017 01:48
Integrate SearchWP and Jetpack Infinite Scroll
<?php
// Jetpack infinite scroll does it's own WP_Query, so we need to hijack it at runtime
function searchwp_infinite_scroll_query_args( $query_args ) {
if( class_exists( 'SearchWPSearch' ) ) {
$query = get_search_query();
if( empty( $query ) ) {
if( isset( $_GET['query_args']['s'] ) ) {
$query = sanitize_text_field( $_GET['query_args']['s'] );
}
@mzeis
mzeis / Standard.php
Created April 2, 2013 19:47
Debug module / controller / action routing in Magento CE 1.7.0.2. Save file as app/code/local/Mage/Core/Controller/Varien/Router/Standard.php
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php