Skip to content

Instantly share code, notes, and snippets.

View howardpanton's full-sized avatar

Howard Panton howardpanton

View GitHub Profile
@howardpanton
howardpanton / gist:1605732
Created January 13, 2012 11:50
Copy ssh file contents
cat ~/.ssh/id_rsa.pub | pbcopy
@howardpanton
howardpanton / wordpress-height-images
Created February 12, 2012 21:06
Remove Height and with from wordpress images
* we will remove all the width and height references, therefore the img tag
* will not add width and height attributes to the image sent to the editor.
*
* @param bool false No height and width references.
* @param int $id Attachment ID for image.
* @param array|string $size Optional, default is 'medium'. Size of image, either array or string.
* @return bool|array False on failure, array on success.
*/
function myprefix_image_downsize( $value = false, $id, $size ) {
if ( !wp_attachment_is_image($id) )
@howardpanton
howardpanton / gist:2084309
Created March 18, 2012 23:08 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
<h1>Testing PHP Tabs</h1>
<?php
$links = array();
$texts = array();
// Add items to array
<t4 type="navigation" id="627"/>
@howardpanton
howardpanton / gist:2991093
Created June 25, 2012 20:42 — forked from thehydroimpulse/gist:2872907
A Laravel task generator. Models, Migrations and Controllers.
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/
@howardpanton
howardpanton / README.md
Created December 1, 2012 21:03 — forked from necolas/README.md
Experimenting with component-based HTML/CSS naming and patterns

Template Components

Used to provide structural templates.

Pattern

t-template-name
t-template-name--modifier-name
t-template-name__subcomponent-name--subcomponent-modifier-name
@howardpanton
howardpanton / browser hacks
Created January 9, 2013 14:31
Browser hacks
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
@howardpanton
howardpanton / breadcrumb
Created January 11, 2013 12:35
PHP breadcrumbs
function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {
$path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
$base = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
$breadcrumbs = Array("<a href=\"$base\">$home</a>");
foreach ($path AS $x => $crumb) {
$title = ucwords(str_replace(Array('.php', '_', '-'), Array('', ' ', ' '), $crumb));
$breadcrumbs[] = "<a href=\"$base$crumb\">$title</a>";
$base = $base.$crumb.'/';
}
return implode($separator, $breadcrumbs);
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
@howardpanton
howardpanton / grid-blocks-four.html
Last active December 17, 2015 03:49
Grid Block Four Up - HTML
<ul class="blocks four-up">
<li>
<div class="media-block region heading-bottom">
<figure>
<a href="#" title="Link title">
<img src="http://placehold.it/210x210" alt="Image Alt">
</a>
</figure>
<div class="media-body">
<h4 class="media-heading-bottom">Course tutor: Valerie Mace</h4>