Skip to content

Instantly share code, notes, and snippets.

View bloqhead's full-sized avatar

Daryn St. Pierre bloqhead

View GitHub Profile
@bloqhead
bloqhead / client-content.html
Created September 17, 2013 20:44
This might as well be your container when handing off to a client and not disabling most WYSIWYG features before letting them make page edits.
<div class="toilet">
<!-- client content here -->
</div>
@bloqhead
bloqhead / grid.scss
Created September 19, 2013 16:02
Grid resizing with Bourbon Neat and selectors. Requires http://bourbon.io and http://neat.bourbon.io
// 481 and up
.gallery {
li {
@include span-columns(6);
&:nth-child(2n) {
margin-right: 0;
}
}
}
@bloqhead
bloqhead / user.json
Created September 19, 2013 17:45
My Sublime Text 2 settings (as of 2013-09-19).
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Base16/base16-tomorrow.light.tmTheme",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": false,
"fade_fold_buttons": false,
"file_exclude_patterns":
[
"*.pyc",
@bloqhead
bloqhead / fetch.json
Created September 19, 2013 18:01
My Sublime Text 2 Fetch package list.
{
"files":
{
"[Bloqhead] CSS Banner": "https://gist.github.com/bloqhead/6a8c13c82bedc702e01b/raw/275d3f27e79d0d57fe30e1290bccbff6c114a7cb/CSSBanner.scss",
"[Bloqhead] Tile Tamer": "https://gist.github.com/bloqhead/03710045d8e79bd7b725/raw/2648ea6fac13a0388b074e400bfbccf3554e6675/tile.tamer.js",
"[Bones] Footer": "https://raw.github.com/eddiemachado/bones/master/footer.php",
"[Bones] Grid Mixins": "https://gist.github.com/bloqhead/a774ed3c5e603b73888e/raw/BonesGrid.scss",
"[Bones] Header": "https://raw.github.com/eddiemachado/bones/master/header.php",
"[CSS] Eric Meyer's Reset": "http://meyerweb.com/eric/tools/css/reset/reset.css",
"[CSS] FlexSlider CSS": "https://raw.github.com/woothemes/FlexSlider/master/flexslider.css",
@bloqhead
bloqhead / pulldown.js
Created September 20, 2013 20:02
Simple jQuery pulldown script.
$('ul#menu-main-menu li').hover( function() {
$('.sub-menu', this).show();
if( $(this).find('.sub-menu').length > 0 ) {
$(this).addClass('active');
}
}, function(){
$('.sub-menu', this).hide();
$(this).removeClass('active');
});
@bloqhead
bloqhead / calc.scss
Created September 30, 2013 21:30
CSS3 calc Sass mixin. Source: https://coderwall.com/p/qac-og
@mixin calc($property, $expression) {
#{$property}: -moz-calc(#{$expression});
#{$property}: -webkit-calc(#{$expression});
#{$property}: calc(#{$expression});
}
@bloqhead
bloqhead / wp_query.php
Created October 1, 2013 14:44
Example WP query that excludes all terms from a custom taxonomy.
<?php
/**
* Taxonomy Exclusion
**/
$tax = 'artists';
$terms = array();
$custom_terms = get_terms( $tax, array( 'fields' => 'names' ) );
if( is_array( $custom_terms ) ) {
$terms = $custom_terms;
}
@bloqhead
bloqhead / post-type.php
Created October 5, 2013 15:14
Simple WordPress custom post type example.
<?php
register_post_type( 'projects',
array(
'labels' => array(
'name' => __( 'Projects' ),
'singular_name' => __( 'Project' ),
'add_new' => __( 'Add Project' ),
'add_new_item' => __( 'Add a Project' )
),
'public' => true,
<script type="text/javascript">
$(function() {
// Vimeo pauser
function pauseVimeo() {
$('iframe[src*="vimeo.com"]').each( function (iterator, object) {
var url = $(object).attr('src').split('?')[0];
object.contentWindow.postMessage(JSON.stringify({ method:"pause" }), url);
});
}
// Attach it to a button
<script type="text/javascript">
$(function(){
if (/iPhone|iPod|iPad/.test(navigator.userAgent))
$('iframe').wrap(function(){
var $this = $(this);
return $('<div />').css({
width: $this.attr('width'),
height: $this.attr('height'),
overflow: 'auto',
'-webkit-overflow-scrolling': 'touch'