Skip to content

Instantly share code, notes, and snippets.

View richerimage's full-sized avatar

Richard Barratt richerimage

View GitHub Profile
@richerimage
richerimage / gist:10734179
Created April 15, 2014 13:47
Add custom images sizes to wordpress
add_image_size( 'Letterbox Large', 851, 315, true );
add_image_size( 'Icon', 75, 75, true );
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'Letterbox Large' => __('Letterbox Large'),
'Icon' => __('Icon'),
) );
}
@richerimage
richerimage / gist:3cfd946243f96ac6b1e7
Last active August 29, 2015 14:00
Add to DNA TinyMCE
function add_tinymce_css($mycss) {
$mycss .= "#tinymce {background: green;}";
return $mycss;
}
add_filter ('dna_tinymce', 'add_tinymce_css');
@richerimage
richerimage / Links-Styling
Created July 6, 2014 12:06
A Pen by Richard Barratt.
@richerimage
richerimage / inject-metatag.js
Created July 19, 2014 10:54
iFrame <head> inject viewport metatag
$(document).ready(function($) {
var viewTag = '<meta content="initial-scale=1, user-scalable=yes, maximum-scale=1, width=device-width" name="viewport">';
var head = $('#iFrame_ID').contents().find('head');
head.append(viewTag);
});
@richerimage
richerimage / terms-and-conditions.md
Created August 6, 2014 20:02
Terms and Conditions

Standard Terms & Conditions

The following terms and conditions, together with a signed project proposal, form an agreement that is intended to protect both parties, and is no way meant to trick or deceive you. we have tried to keep the wording as plain as possible, but if anything is unclear we will be more than happy to clarify it with you.

In short, [CLIENT NAME] — referred to as "you" — is engaging Richard Barratt T/A Richer Image — referred to as "We, us, Ourselves" — to undertake the work as specified in the attached proposal, under the requirements of these terms and conditions.

Deadlines

We will do our best to meet all agreed deadlines. You agree to review our work and provide feedback and approval in a timely manner. You accept that delays in supplying required information or materials might result in significantly longer delays to the delivery of the finished work. You also accept that webdesign and coding can enounter the unexpeced which may have an effect on timescales.

Responsive Equal Height Divs

This pattern is a fork of a CSS Tricks Post

To adapt this pattern for responsive use I placed it into a function and called it each time the window was resized. One note is that you must reset the div heights before you take a new measurement.

Pros

The Equal Height Rows Designers Crave - If a desiger uses a box, those boxes better line up or they lose their Adobe license. Really!

@richerimage
richerimage / Restrict Access to Specific IPs
Last active August 29, 2015 14:05
Restrict Access to Specific IPs
Order deny,allow
Deny from all
Allow from ##.###.###.###
Allow from ##.###.###.###
@richerimage
richerimage / inject_file_content.php
Created August 16, 2014 09:45
Inject a file's content with a shortcode
function getfile_content( $atts ) {
extract( shortcode_atts( array(
'fileurl' => ''
), $atts ) );
if ($fileurl!='')
return @file_get_contents($fileurl);
}
@richerimage
richerimage / .htaccess
Created September 4, 2014 21:43
.htaccess
<filesmatch "\.(jpg|gif|png|css|js|htc)(\?.*)?$">
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
</filesmatch>
@richerimage
richerimage / ol-start-num
Created September 5, 2014 09:55
Start your <ol> List at any given number
<ol start="5">
<li>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</li>
<li>Nullam id dolor id nibh ultricies vehicula ut id elit.</li>
<li>Vestibulum id ligula porta felis euismod semper.</li>
</ol>