Skip to content

Instantly share code, notes, and snippets.

View thinkstylestudio's full-sized avatar

Theron Smith thinkstylestudio

View GitHub Profile
#!/bin/bash
homebrew_packages=(
freetype
jpeg
libpng
gd
zlib
openssl
unixodbc
<?php
/**
* Includes extensions for Gravity Forms to SugarCRM and Hubspot
* The demo code with all fields is located at the bottom of the file
* for future reference so we don't have to hunt it down later
*
* Don't forget to read the link on how to finish off the SugarCRM
* integration. I'll blog about it eventually so it's all in one
* spot.
*
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<?php
/*
Plugin Name: PageLines Security Patcher
Description: Blocks the recent exploits for legacy themes in the event you cant update the themes.
Version: 1.0
Author: PageLines
*/
class Fix_Pagelines_Legacy {
function __construct() {
if ( ! defined( 'WCS_DEBUG' ) ) {
define( 'WCS_DEBUG', true );
}

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
/**
* Add a Gravity forms form to product upon database save.
*
* Requires Gravity Forms and WooCommerce - Gravity Forms Product Add-Ons.
*
* Search for '_gravity_form_data' in wp_postmeta and set $raw_form_data to the serialized string.
*
* @return void
**/
function mb_woo_product_insert_form($product_ID) {
<?php
/**
* Delete a post meta transient.
*/
function delete_post_meta_transient( $post_id, $transient, $value = null ) {
global $_wp_using_ext_object_cache;
$post_id = (int) $post_id;
do_action( 'delete_post_meta_transient_' . $transient, $post_id, $transient );
@thinkstylestudio
thinkstylestudio / sql-command.sql
Last active August 29, 2015 14:25 — forked from BFTrick/sql-command.sql
A SQL command to delete all orphaned post meta data
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL
Show errors:
$wpdb->show_errors = true shows errors automatically, if WP_DEBUG is set to true.
$wpdb->suppress_errors = false stops suppressing errors.
Multisite need special treatment
// Show errors in Multisite:
global $wpdb, $blog_id;
// There's no is_multisite(), so we need to check the ID