Skip to content

Instantly share code, notes, and snippets.

View pcfreak30's full-sized avatar

Derrick Hammer pcfreak30

View GitHub Profile

Keybase proof

I hereby claim:

  • I am pcfreak30 on github.
  • I am pcfreak30 (https://keybase.io/pcfreak30) on keybase.
  • I have a public key ASDjNDj97GfFvEx3DMsOw7QvgyV0utEYj3ZnJCAdc3Yo_go

To claim this, I am signing this object:

@pcfreak30
pcfreak30 / .env
Last active April 10, 2020 10:11 — forked from tylers-username/.env
Install Blackfire on Lando & Automatically Configure
BLACKFIRE_CLIENT_ID=b5ee8ca3-****-****-****-5d227546a4c0
BLACKFIRE_CLIENT_TOKEN=3a2b88cbfb*******************************22763
BLACKFIRE_SERVER_ID=4b8ac335-****-****-****-b34439207732
BLACKFIRE_SERVER_TOKEN=98f7fdf4b12b7**************************12b837cf080d
<?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)
*/
@pcfreak30
pcfreak30 / Get person content - Ajax
Last active December 18, 2019 21:40 — forked from nikolab/Get person content - Ajax
Get person content - Ajax
//team showcase
$(document).unbind("click").on("click", ".tshowcase-box", function (event) {
$this = $(this);
$this.siblings().removeClass('active');
$('.person-content-wrap').hide();
$this.toggleClass('active');
var url = $(this).find('a').attr('href'); //get url
var new_url = url.substring(0, url.indexOf(' ')); //substirng url
//get person content
<?
if (!class_exists("BP_Shortcodes"))
{
class BP_Shortcodes
{
public $call;
public function __construct()
{
@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
@pcfreak30
pcfreak30 / gist:4991458ca5e58261a283fa5bc6f2535c
Created September 9, 2017 01:48 — forked from jchristopher/gist:9331899
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'] );
}
@pcfreak30
pcfreak30 / taxonomy.php
Last active December 19, 2016 16:18 — forked from anonymous/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 December 22, 2016 19:24
YARPP_Cache ksort Class Fix for WordPress 4.7
<?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 04:39
Google Native Client Hello Tutorial CMake 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")