Skip to content

Instantly share code, notes, and snippets.

View data-enhanced's full-sized avatar

David Cochran data-enhanced

View GitHub Profile
/* 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 / 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.

@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 / 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'

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 / 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;
@data-enhanced
data-enhanced / jquery-scrollto-simple.js
Created December 23, 2013 13:31
Animate scroll to all page anchors within the page
// Animate scroll to all page anchors
$('[href^=#]').click(function (e) {
e.preventDefault();
var div = $(this).attr('href');
$("html, body").animate({
scrollTop: $(div).position().top
}, "slow", "swing");
});
@data-enhanced
data-enhanced / clear-sm-bootstrap.less
Created December 24, 2013 19:55
Create a mixin .clear-sm to configure an element to clear the items above it only within a specified media query.
/*
In a situation such as this markup
where we want columns to organize themselves
into two rows at on smaller screens.
This Bootstrap 3 markup gets us most of the way there.
<div class="col-sm-4 col-md-2">
...
<div class="col-sm-4 col-md-2">
...
<div class="col-sm-4 col-md-2">
@data-enhanced
data-enhanced / products-grid.less
Created January 1, 2014 23:03
Create a grid of product items using display: inline-table
.products-grid {
display: table;
}
.product-item {
float: none; // override default grid floating behavior
display: inline-table;
margin-right: -1em; // http://www.tylercipriani.com/2012/08/01/display-inline-block-extra-margin.html
vertical-align: top; // Safari defaults to vertical-align center
}