Skip to content

Instantly share code, notes, and snippets.

@oranblackwell
oranblackwell / Git - Check which tag you are currently on
Created April 17, 2014 14:03
Git - Check which tag you are currently on
git describe --tags

Row and Column Paddings

div[class*="col-"].no-padding { padding : 0; }
div[class*="col-"].no-padding-left { padding-left : 0; }
div[class*="col-"].no-padding-right { padding-right : 0; }
.top-buffer { margin-top : 20px; }

Pull-Right Breakpoints

@media (min-width : 768px) {

Various Wordpress Snippets

Add image dimensions

add_image_size( 'category-single', 285, 220, true ); // home page grid & category side
add_image_size( 'category-double', 285, 510, true ); // home page grid

Show which template file is currently being used.

Emmet string for Our Clubs Page
<!-- EMMET -->
.show-outline>(.row>(.col-sm-6.col-xs-12>.media>(img.pull-left+.media-body>h2{h2 here})+p.the_content{the content here})+(.col-sm-6.col-xs-12>(.col-xs-12>h3{h3 here})+((.col-sm-4.col-xs-12>.repeater_label{repeater label $})+(.col-sm-8.col-xs-12>.repeater_value{repeater value $}))*3))+.row>.col-xs-12.collapsible>(header>h3{h3 here})+(.col-sm-6.col-xs-12>h4{h4 here}+img.social-icons*4)+(.col-sm-6.col-xs-12>(.col-sm-4.col-xs-12{label $}+.col-sm-8.col-sm-12{value $})*3)|c
@oranblackwell
oranblackwell / ImagePlaceHolderService.md
Created June 10, 2014 08:12
Image Placholder Service

Placeholder It

http://www.placehold.it/150x190

<img src="//placehold.it/150x190" class="img-responsive">

Add Text:

http://www.placehold.it/350x123&text=this+is+text
@oranblackwell
oranblackwell / functions.php.md
Last active August 29, 2015 14:02
Wordpress Responsive Images

Selectively Serve Images

Please note the naming convention for each pair.

<?php
/**
 * Set up custom image sizes
 *
 * @author Oran Blackwell
@oranblackwell
oranblackwell / functions.php.md
Last active August 29, 2015 14:02
Returns responsive checkerboard pattern for use with Bootstrap 3

Creates a checkerboard pattern automatically from within a loop.

<?php 
/**
 * Return alternating rows and columns
 * - on a 2x4 grid : 01-10-01-10
 * - on a 1X8 grid : 0-1-0-1-0-1-0-1
@oranblackwell
oranblackwell / HTML5-Shiv-and-Respond-JS.md
Last active August 29, 2015 14:02
Add HTML5 Shiv and Respond .js to end of wp_head()

Wordpress - Add HTML5 shiv, Respond.js for IE8

<?php 
/**
 * Add HTML5 shiv, Respond.js for IE8
 */
add_action( 'wp_head', 'ie_support_header', 99 );
function ie_support_header() {
	echo '
@oranblackwell
oranblackwell / example.md
Last active August 29, 2015 14:02
Simple Git Deployment using Tags

Simple Git Deployment using Tags

Example 1

Local

[ ~/Web/Sites/Example]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
@oranblackwell
oranblackwell / debug
Created December 1, 2014 16:42
For Daniel
<?php
if ( !function_exists ( 'debug' ) ) {
/**
* @author Oran Blackwell
* @version 3.6.1
* Change log:
* 3.6.1 - inelegantly added var_dump to is_object()
* 3.6.0 - Added DEFINE_ declaration for check_mysql_errors & mysql_query_log
* - Added internal Repo hosting IPs to allowed array (O2)