Skip to content

Instantly share code, notes, and snippets.

Derrick Hammer pcfreak30

Block or report user

Report or block pcfreak30

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9a6b183f033924e583003f35bbe0391f
<?
if (!class_exists("BP_Shortcodes"))
{
class BP_Shortcodes
{
public $call;
public function __construct()
{
@pcfreak30
pcfreak30 / alloptions.php
Last active Dec 13, 2018 — forked from lukecav/functions.php
Fix a race condition in alloptions caching in WordPress
View alloptions.php
<?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
@pcfreak30
pcfreak30 / gist:4991458ca5e58261a283fa5bc6f2535c
Created Sep 9, 2017 — forked from jchristopher/gist:9331899
Integrate SearchWP and Jetpack Infinite Scroll
View gist:4991458ca5e58261a283fa5bc6f2535c
<?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'] );
}
View taxonomy.php
<?php get_header(); ?>
<div id="main-content">
<div class="container">
<div id="content-area" class="clearfix">
<div id="left-area">
<h1><?php single_cat_title(); ?></h1>
<div><?php echo get_term_meta( get_queried_object()->term_id, 'location_description', true ); ?></div>
@pcfreak30
pcfreak30 / YARPP_Cache.php
Last active Dec 22, 2016
YARPP_Cache ksort Class Fix for WordPress 4.7
View YARPP_Cache.php
<?php
abstract class YARPP_Cache {
protected $core;
protected $yarpp_time = false;
public $score_override = false;
public $online_limit = false;
public $last_sql;
@pcfreak30
pcfreak30 / CMakeLists.txt
Created May 31, 2016
Google Native Client Hello Tutorial CMake CMakeLists.txt
View CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(hello_tutorial)
if (NOT ENV{NACL_SDK_ROOT})
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
get_filename_component(NACL_SDK_ROOT "${PARENT_DIR}/.." REALPATH)
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98 -Wno-long-long -Wall -Wswitch-enum -pedantic -Werror")
@pcfreak30
pcfreak30 / index.php
Created Mar 30, 2014
Simple Login System
View index.php
<?php
require "session.php";
if(empty($_SESSION['loggedin']))
{
include('templates/index.php');
die();
}
else
You can’t perform that action at this time.