Skip to content

Instantly share code, notes, and snippets.

View drrobotnik's full-sized avatar

Brandon drrobotnik

  • ThermoFisher Scientific
  • San Diego
View GitHub Profile
define('WP_DEBUG', true);
// define('SCRIPT_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
//define('WP_DEBUG_LOG', true);
// Default WP_DEBUG_LOG sets within wp-content directory, if your wp-config file is above root, use this:
ini_set( 'log_errors', true );
ini_set( 'error_log', dirname(ABSPATH) . '/debug.log' );
@drrobotnik
drrobotnik / wp-config.php
Created May 13, 2014 22:41
master-config
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information by
* visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
/**
* On the fly image cropping based on WP 3.5 image editor
*
* @since 1.0
*
* @param int $id
* @param int $width
* @param int $height
* @param boolean $crop
* @return string
<?php
/**
* WordPress API for media display.
*
* @package WordPress
* @subpackage Media
*/
/**
* Scale down the default size of an image.
@drrobotnik
drrobotnik / functions.php
Created May 20, 2014 18:27
get first image in post set/delete all post thumbnails
/**
* Grab first image from $post->post_content
*
* @since 1.0
*
* @return string
*/
function cv_post_first_image( $post_obj = null ) {
if( empty($post_obj) )
global $post;
wp_enqueue_script( 'addthis', '//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4ee8386e3c529ef2', array(), 0, true );
<a class="addthis_button_compact" addthis:url="<?php echo get_permalink(); ?>" addthis:title="<?php the_title(); ?>"><span>share</span></a>
@drrobotnik
drrobotnik / style.less
Created June 5, 2014 22:18
make columns
.coffee-row{ .make-row(0); }
.coffee-column{ .make-xs-column(1.71428; 0); }
@drrobotnik
drrobotnik / _vars.scss
Created June 5, 2014 23:27
sass arrays
$brand-colors: (
#00785f, // turquise
#413b35 // dark brown
);
a{
color:nth($brand-colors,2);
}
@drrobotnik
drrobotnik / loader.php
Created June 10, 2014 18:13
mu-plugin loader
<?php
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$loaded_plugins = array();
//Loop through all plugins in MU Plugins directory.
//Note get_plugins requires path relative to plugins dir.
foreach ( get_plugins( '/../' . basename( __DIR__ ) ) as $plugin_path => $plugin ) {
/**
* Get template part (for templates like the shop-loop).
*
* @access public
* @param mixed $slug
* @param string $name (default: '')
* @return void
*/
function wc_get_template_part( $slug, $name = '' ) {
$template = '';