Skip to content

Instantly share code, notes, and snippets.

@oranblackwell
oranblackwell / bootstrap-3-clearfix.md
Last active January 17, 2018 10:27
Auto clearfix for Bootstrap 3's cols. (From within a loop)

Auto-insert Bootstrap 3's clearfix for differnt viewport sizes.

<?php 
/**
 * Bootstrap auto clearfix from inside loops.
 * Put this function at the start of the loop before other bootstrap cols are called.
 *
 * @param       int   $i The count from within the loop where the function is called. Starting with 0.
 * @param       array $args ['xs'=> 12, 'sm' => 6, 'md' => 4, 'lg' => 3]
@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 / 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 / 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
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

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.

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) {
@oranblackwell
oranblackwell / 01. Notes.md
Last active March 22, 2018 22:24
Terminal commands

Various Terminal Commands

Creating Aliases

Note on interpolation

Invoked as an interactive login shell, or with `--login'

# Interactive means you can enter commands. The shell is not running because 
#+ a script has been activated. A login shell means that you got the shell after
@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
@oranblackwell
oranblackwell / LikeXML
Created December 16, 2013 12:05
Replicate default XML stylesheet with collapsable sections.
<style>
.likeXML{margin:20px 0}
.likeXML .text{color:#000;font-size:12px}
.likeXML .start-tag,.likeXML .end-tag{
color:#800080 !important;
text-transform:uppercase;
cursor:pointer;
font-weight:bold;
font-size:12px
}