Skip to content

Instantly share code, notes, and snippets.

View michaelcummings's full-sized avatar

Michael michaelcummings

  • Andromeda
  • Dallas, Texas
View GitHub Profile
@wkw
wkw / README.md
Last active September 15, 2025 03:34
WordPress functions to selectively disable WPEngine site caching temporarily.

Controlled WPEngine Cache Busting

This technique was used to control WPEngine's caching by making WPE think there was a WordPress CMS user logged in by setting a fake cookie.

This code was developed to display site-wide dynamic content when a user authenticated against an external (non-WordPress) service.

N.B.: this worked as of 10/2015, but WPE may make infratructure changes which break the technique.

Usage

@cfxd
cfxd / bs3-contact-form-7.less
Last active June 8, 2021 07:29
Bootstrap 3 default styles for Contact Form 7
/*
*
* Bootstrap 3 reset for CF7
*
*/
input, textarea {
&.wpcf7-form-control {
&:extend(.form-control all);
&.wpcf7-validates-as-required.wpcf7-not-valid {
@arunoda
arunoda / gist:7790979
Last active March 13, 2025 14:30
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

<?php
/**
* Enqueue Tweet Script
*
*/
function be_enqueue_tweet_script() {
wp_enqueue_script( 'be-tweet', get_stylesheet_directory_uri() . '/tweet-quote.js', array( 'jquery' ), '1.0', true );
}
add_action( 'wp_enqueue_scripts', 'be_enqueue_tweet_script' );
@wesbos
wesbos / is_blog.php
Created September 2, 2011 19:32
WordPress is_blog()
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>
@sente
sente / reddit.html
Created April 28, 2011 22:32
An example of a retrieving data from reddit's JSON(p) api using jquery
<!DOCTYPE html>
<!--
Stuart Powers
http://sente.cc/
http://twitter.com/stuartpowers
-->
<html>
<head>