Skip to content

Instantly share code, notes, and snippets.

View data-enhanced's full-sized avatar

David Cochran data-enhanced

View GitHub Profile
@data-enhanced
data-enhanced / wp-loop-exclude-post-query
Created October 29, 2013 20:51
Exclude a certain post from the loop.
From:
http://wordpress.org/support/topic/multiple-loops-if-first-post-in-loop-1-matches-first-post-in-loop-2-skip
Add this after the query:
$check = get_posts('cat=3&numberposts=1');
if ( $check[0]->ID == $post->ID ) continue;

HTML5 Markup Template - Basic

A very basic starter template with fundamental HTML5 markup -- only the basics.

Based on HTML5 Bones | http://html5bones.com

@data-enhanced
data-enhanced / terminal-aliases.md
Last active December 26, 2015 04:49
Some of my favorite Terminal aliases

Some of the Aliases I use in my .bash_profile for OS X Terminal:

# Open a file in Sublime Text 2
alias subl='open -a Sublime\ Text\ 2'

#Edit Bash Profile in Sublime Text 2
alias bashprof='subl .bash_profile'

# Open a file in desired browser

alias ff='open -a Firefox'

@data-enhanced
data-enhanced / open-with-sublime-text2.md
Last active December 26, 2015 04:49
Open a file from OS X Terminal in Sublime Text 2

We'll create a Terminal alias to efficiently open a chosen file in Sublime Text 2.

From Terminal ...

Edit the bash profile, by typing:

vim .bash_profile

Then type i to insert.

@data-enhanced
data-enhanced / open-browsers-commandline.md
Last active December 26, 2015 04:48
Use OS X Terminal to open a chosen file (or URL) in Firefox, Safari, or Google Chrome

We'll create Terminal aliases to efficiently open files in our browser of choice.

From Terminal ...

Edit the bash profile, by typing:

vim .bash_profile

Then type i to insert.

/* See Chris Coyier CSS Tricks
http://css-tricks.com/perfect-full-page-background-image/
*/
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
@data-enhanced
data-enhanced / hide-mobile-safari-chrome.js
Created July 14, 2013 20:45
Quick fix to hide browser address bar in mobile safari -- Credit David Walsh -- http://davidwalsh.name/hide-address-bar
// Credit David Walsh
// http://davidwalsh.name/hide-address-bar
window.addEventListener("load",function() {
// Set a timeout...
setTimeout(function(){
// Hide the address bar!
window.scrollTo(0, 1);
}, 0);
});
@data-enhanced
data-enhanced / inline-table.css
Created May 15, 2013 19:03
Grid of items using inline-table to handle items of various heights by keeping each row the height of the tallest item
.products-grid {
display: table;
}
.product-item {
display: inline-table;
vertical-align: top; // needed by Safari
width: 46%;
margin-left: 2%;
}
@data-enhanced
data-enhanced / grid-inline-table.less
Created May 2, 2013 16:53
LESS to display a products grid that can dynamically adjust the number of products per row, while keeping each row the height of the tallest product div. Using CSS 2 display: inline-table. Compatible with IE8 and better browsers.
//
// Products Grid
// --------------------------------------------------
@media screen and (min-width: @tablet-min-width) {
.products-grid {
display: table;
.product-item {
display: inline-table;
width: 46%;