Skip to content

Instantly share code, notes, and snippets.

View dhigginbotham's full-sized avatar
😸
happycat

David Higginbotham dhigginbotham

😸
happycat
View GitHub Profile
@dhigginbotham
dhigginbotham / framework.css
Created August 9, 2012 00:34
CSS Utility Framework
/* ==|== framework styles ===================================================
Author: DHigginbotham
========================================================================== */
/* apply a natural box layout model to all elements <3 paul irish */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}
/* prefixes */
div { display: block; margin: 0; padding: 0; }
.pull-right { float: right; }
@dhigginbotham
dhigginbotham / gist:3718052
Created September 13, 2012 22:08
Custom Post Type w/ Taxonomies and Categories
// let's create the function for the custom type
function custom_post_example() {
// creating (registering) the custom type
register_post_type( 'custom_type', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
// let's now add all the options for this post type
array('labels' => array(
'name' => __('Custom Types', 'bonestheme'), /* This is the Title of the Group */
'singular_name' => __('Custom Post', 'bonestheme'), /* This is the individual type */
'all_items' => __('All Custom Posts', 'bonestheme'), /* the all items menu item */
'add_new' => __('Add New', 'bonestheme'), /* The add new menu item */
@dhigginbotham
dhigginbotham / gist:3844128
Created October 6, 2012 05:48
Query Multiple Post Types with same Query
//try to include two post types in main query
function query_multiple_posts_types( $query ) {
if ( is_home() ) {
//Display 20 posts
$query->query_vars['posts_per_page'] = 20;
//Display multiple post types
$query->query_vars['post_type'] = array('post', 'portfolio');
return;
}
}
@dhigginbotham
dhigginbotham / gist:3846919
Created October 7, 2012 02:47
foreach loop custom post types fed through array
// let's create the function for the custom type
function custom_posts() {
$post_types = array('software','resources');
foreach ($post_types as $slug) {
// creating (registering) the custom type
register_post_type( $slug, /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
// let's now add all the options for this post type
array('labels' => array(
@dhigginbotham
dhigginbotham / tt.fm-autobop.js
Created November 21, 2012 08:02
New Turntable.fm Autobop Script
var count = 0;
!function () {
ab_functs(count);
ttout = window.setTimeout(ab_functs, 5000 * 60 );
}();
function ab_functs(count) {
count++;
console.log('I\'ve bopped for you now ' + count + ' times!');
$(window).focus();
@dhigginbotham
dhigginbotham / gist:4630141
Last active December 11, 2015 16:48
Loan Calculator yayQuery
var s,
LoanCalculator = {
settings: {
apr: jQuery("#lc_interest_rate").val(),
term: jQuery("#lc_term_length").val(),
price: jQuery("#lc_amount").val(),
button: jQuery("#lc_calculate"),
amount: 0,
result: jQuery("#lc_payments")
var _s
, FacebookConnect = {
settings: {
status: null,
login: $('#facebook-auth')
},
init: function() {
_s = this.settings;
this.bindUI();
/*
This handles the FBAsync login as well as the Authentication bit
*/
var _s
, FacebookConnect = {
settings: {
status: null,
/**
* Module dependencies.
Current Version: 0.0.3
*/
var express = require('express')
, io = require('socket.io')
var _s
, FacebookConnect = {
settings: {
status: null,
me: null,
login: $('#facebook-auth'),
share: $('#facebook-share')
},