Skip to content

Instantly share code, notes, and snippets.

View mannieschumpert's full-sized avatar

Mannie Schumpert mannieschumpert

View GitHub Profile
@mannieschumpert
mannieschumpert / gist:3f30e5ffa068a0525915
Created October 14, 2014 15:37
W3 Total Cache's approach to conditional loading is rather elegant.
<?php
/**
* Skip caching for some pages
*/
switch (true) {
case defined('DONOTCACHEPAGE'):
case defined('DOING_AJAX'):
case defined('DOING_CRON'):
case defined('APP_REQUEST'):
@mannieschumpert
mannieschumpert / gist:2f89bcd1eb5a540dad59
Last active April 18, 2017 16:56
Remove all themes auto-installed by Softaculous on SiteGround
# move into the themes folder
cd public_html/wp-content/themes
# remove unwanted themes
# of course remove the older WP default themes from the script if you want to keep them
rm -rf -- {Builder-Cohen,Builder-Paige,World,siteground-wp23,siteground-wp73,Builder-Madison,Universe,siteground-wp63,twentythirteen,twentytwelve}
<?php
array(
'^wp-json/?$' => 'index.php?rest_route=/',
'^wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]',
'category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',
'category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',
'category/(.+?)/embed/?$' => 'index.php?category_name=$matches[1]&embed=true',
'category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]',
'category/(.+?)/?$' => 'index.php?category_name=$matches[1]',
'tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',
@mannieschumpert
mannieschumpert / gist:8480059
Last active January 3, 2016 14:59
A PHP script to add a list of tasks to Asana via an array.
<?php
$apikey = ""; // Your API key
$workspace = ''; // your project's workspace ID
$project = ''; // your project's ID
$tasks = array(
'Task 1',
'Task 2',
'Task 3'
// etc
@mannieschumpert
mannieschumpert / gist:8477368
Last active January 3, 2016 14:39
Domain propagation auto-checking. Checks IP of a domain every ten minutes.
while :
do
nslookup domain.com
sleep 600
done
@mannieschumpert
mannieschumpert / SassMeister-input-HTML.haml
Created January 11, 2014 18:41 — forked from a5e/SassMeister-input-HTML.haml
Generated by SassMeister.com.
%h1
= "π"
.pi
-(1..300).each do |j|
.digit
<?php
/**
* Filters the next, previous and submit buttons.
* Replaces the forms <input> buttons with <button> while maintaining attributes from original <input>.
* @param string $button Contains the <input> tag to be filtered.
* @param object $form Contains all the properties of the current form.
* @return string The filtered submit button.
*/
add_filter( 'gform_next_button', 'input_to_button', 10, 2 );
add_filter( 'gform_previous_button', 'input_to_button', 10, 2 );
@mannieschumpert
mannieschumpert / enqueue.php
Last active December 31, 2015 04:29
Optionally enqueue LiveReload for local development.
<?php
/**
* Enqueue LiveReload if local install
*
* Assumes livereload.js is in the root folder of your local site
*
* This should be fairly reliable,
* but may need to be changed for some environments
*/
@mannieschumpert
mannieschumpert / SassMeister-input.sass
Created December 6, 2013 16:59 — forked from scottkellum/SassMeister-input.sass
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.7)
// ----
=e($name)
@at-root #{&}__#{$name}
@content
=m($name)
@at-root #{&}--#{$name}
@mannieschumpert
mannieschumpert / SassMeister-input.scss
Created December 6, 2013 16:58
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@import "SassyLists";
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)