View setup-new-mac.sh
1 2 3 4 5 6 7 8 9
#!/bin/bash
# (not really -- run these commands by hand & pay attention to the comments)
 
# Homebrew: The missing package manager for OS X
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 
# Git
brew install git
git config --global --add merge.ff false
View sql_to_get_database_sizes_in_phpMyAdmin
1 2 3
SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;
View better_backtracing_in_wordpress.php
1 2 3 4 5 6 7 8 9 10
<?php
/*
* Better backtracing to fix dodgy themes and plugins. Pop this into mu-plugins
*/
function sennza_backtrace() {
echo implode( '<br>', explode( ',', wp_debug_backtrace_summary( null, 4 ) ) );
};
add_action( 'deprecated_function_run', 'sennza_backtrace' );
View config.local.yaml
1 2 3 4 5 6 7 8 9
# Chassis Configuration
#
# This file is the default configuration for all projects. The fallback order of
# configuration files is:
#
# - project/content/config.local.yaml (project-specific overrides)
# - project/content/config.yaml (project-specific defaults)
# - project/config.local.yaml (global overrides)
# - project/config.yaml (global defaults)
View add_tinymce_custom_classes_with_backwards_compatibility.php
1 2 3 4 5 6 7 8 9 10
<?php
Sometimes we want to give clients access to additional styles in TinyMCE. These functions also handle backwards compatibility with WordPress as TinyMCE 3 and TinyMCE 4 handle this differently
function sennza_mce_buttons( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
add_filter( 'mce_buttons_2', 'sennza_mce_buttons' );
function sennza_mce_before_init( $init_array ) {
View sennza_testimonials.php
1 2 3 4 5 6 7 8 9 10
<?php function sz_get_testimonials( $page_id ){
$testimonials = get_post_meta( $page_id, 'testimonial', false );
if ( $testimonials ) {
$testimonial_list = "\n<ul>\n";
foreach ( $testimonials as $testimonial ) {
$testimonial_image = false;
$testimonial_content = false;
$testimonial_list .= "\t<li class='row'>";
if ( $testimonial['testimonial-image'] ) {
$testimonial_image = wp_get_attachment_image( $testimonial['testimonial-image'], 'full', '', array( 'class' => 'columns small-3' ) );
View add_foundation_5_columns_to_wordpress_tinymce.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* Pop this into your functions.php if you like :)
*
*/
function jordesigns_mce_buttons( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
add_filter( 'mce_buttons_2', 'jordesigns_mce_buttons' );
View post_thumbnail_html_foundation_wordpress.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* We need to filter our post thumbnails so we can output them in a format that Foundations Interchange needs.
* We also need a fallback for no JavaScript
*
* @param $html
* @param $post_id
* @param $post_thumbnail_id
* @param $size
* @param $attr
View gist:8233624
1 2 3 4 5 6 7 8 9 10
/* Set up a variable for maths */
 
$doc-font-size: 16;
 
/* the font-size mixin */
 
@mixin font-size($size) {
font-size: 0px + $size;
font-size: 0rem + $size / $doc-font-size;
}
Something went wrong with that request. Please try again.