Skip to content

Instantly share code, notes, and snippets.

View dnaber-de's full-sized avatar
🏠
Working from home

David Naber dnaber-de

🏠
Working from home
View GitHub Profile
@thefuxia
thefuxia / hide-dead-menu-metaboxes.php
Last active September 17, 2021 15:25
T5 Hide dead menu metaboxesWordPress Plugin to improve the menu management screen.
<?php
/**
* Plugin Name: T5 Hide dead menu metaboxes
* Description: Do not show menu metaboxes when no nav menu exists.
* Plugin URI: https://gist.github.com/thefuxia/4432959
* Version: 2013.01.02
* Author: Fuxia Scholz
* Author URI: https://fuxia.me
* Licence: MIT
* License URI: http://opensource.org/licenses/MIT
@markjaquith
markjaquith / plugin-deploy.sh
Created November 16, 2012 05:04 — forked from scribu/plugin-deploy.sh
Plugin deploy script
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
function log( change ) {
// Note that |change.object| is actually a reference to the
// target object.
if ( change.type === "read" ) {
console.log( "What was accessed? ", change.name );
console.log( "What value was given? ", change.oldValue );
}
else {
@billerickson
billerickson / gist:2047229
Last active July 10, 2023 22:04
Improve performance of WP_Query
<?php
$args = array(
// Normal query goes here //
'no_found_rows' => true, // counts posts, remove if pagination required
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
);
@mattweber
mattweber / README.txt
Created March 1, 2012 04:09
ElasticSearch Multi-Select Faceting Example
This is an example how to perform multi-select faceting in ElasticSearch.
Selecting multiple values from the same facet will result in an OR filter between each of the values:
(facet1.value1 OR facet1.value2)
Faceting on more than one facet will result in an AND filter between each facet:
(facet1.value1 OR facet1.value2) AND (facet2.value1)
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh).