Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Nelson joshuadavidnelson

View GitHub Profile
@dartiss
dartiss / functions.php
Created Nov 15, 2017
WordPress Plugin to Suppress Skimlinks Output
View functions.php
<?php
function skim_suppress( $paras = '', $content = '' ) {
return '<div class="noskim">'. do_shortcode( $content ) . '</div>';
}
add_shortcode( 'noskim', 'skim_suppress' );
?>
@benjamincharity
benjamincharity / autonomous.txt
Last active Oct 29, 2020
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
View autonomous.txt
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
View basic-wp-query.php
<?php
$args = array(
'post_type' => array( 'post' ),
'post_status' => array( 'publish' ),
'posts_per_page' => 100, // don't use -1, pick something reasonable
'no_found_rows' => true, // useful when pagination is not needed.
'update_post_meta_cache' => false, // useful when post meta will not be utilized.
'update_post_term_cache' => false, // useful when taxonomy terms will not be utilized.
// 'ignore_sticky_posts' => true, // ignore sticky posts
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@adamplabarge
adamplabarge / gf-acf-image-attachment-maker.php
Last active Oct 27, 2016
GF-ACF image attachment maker
View gf-acf-image-attachment-maker.php
<?php
//* the the default upload path to work in normal WP structure
add_filter("gform_upload_path", "change_upload_path", 20, 2);
function change_upload_path($path_info, $form_id){
$wp_upload_path = wp_upload_dir();
$path_info["path"] = $wp_upload_path['path'] . '/';
$path_info["url"] = $wp_upload_path['url'] . '/';
return $path_info;
View gist:4fa3c4228a8bb53cc71d
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@amdrew
amdrew / gist:07cec5563ab95720dca5
Created Dec 18, 2014
Easy Digital Downloads - Add specific download to cart if it doesn't already exist
View gist:07cec5563ab95720dca5
<?php
/**
* Add a specific download to the cart if not already there
*/
function sumobi_edd_add_download_to_cart_if_empty() {
$download_id = 123;
$cart = function_exists( 'edd_get_cart_contents' ) ? edd_get_cart_contents() : false;
View eu_cookie_banner.js
@jaydansand
jaydansand / wp_allow_update_notifications.php
Last active Jun 29, 2020
WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
View wp_allow_update_notifications.php
<?php
/*
Plugin Name: Allow Update Notifications
Plugin URI: https://gist.github.com/jaydansand/2e41490a8b040a199db4
Description: WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
Version: 1.0
Author: Jay Dansand, Technology Services, Lawrence University
Author URI: https://gist.github.com/jaydansand
*/
/* Copyright 2014 Lawrence University
@jtsternberg
jtsternberg / cmb-toggle-fields.css
Last active May 11, 2017
hidden-toggle for cmb. Works like the WordPress metabox toggle (but for only a selection of fields)
View cmb-toggle-fields.css
.advanced-toggle .toggle-label {
cursor: pointer;
display: block;
line-height: 3em;
border-bottom: 1px solid #e9e9e9;
border-left: 1px solid #e9e9e9;
border-right: 1px solid #e9e9e9;
padding-left: .8em;
}
.advanced-toggle .inside .cmb-row {
You can’t perform that action at this time.