Skip to content

Instantly share code, notes, and snippets.

View richerimage's full-sized avatar

Richard Barratt richerimage

View GitHub Profile
add_shortcode('shortcode', array($this, 'my_shortcode'));
public function my_shortcode($atts, $content = null) {
extract(shortcode_atts(array(
"tag" => 'div',
"class" => '',
"id" => '',
), $atts));
@richerimage
richerimage / Add svg to Wordpress
Last active August 29, 2015 14:06
Add SVG to WordPress Image Uploader
class dna_custom_class extends thesisdna {
public function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'styles'));
add_filter( 'upload_mimes', array($this, 'cc_mime_types'));
}
@richerimage
richerimage / TinyMCE Styles
Created September 8, 2014 15:46
Add styles to TinyMCE in DNA Skin
class dna_custom_class extends thesisdna {
public function __construct() {
add_filter ('dna_tinymce', array($this, 'add_my_tinycss'));
}
public function add_my_tinycss($dna_admin_css) {
@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>
@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 / 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 / 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 ##.###.###.###

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 / 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.

@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);
});