Skip to content

Instantly share code, notes, and snippets.

View isGabe's full-sized avatar
👨‍💻
:party-code:

Gabriel Luethje isGabe

👨‍💻
:party-code:
View GitHub Profile
@isGabe
isGabe / index.html
Created May 22, 2013 17:31
HTML/CSS/JS: Mobile Menu Toggle with CSS Transitions & JS Fallback #snippet
<a id="mobile-menu-toggle" href="#">Menu</a>
<nav id="main-nav" class="closed">
<ul>
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
<li><a href="#">Four</a></li>
<li><a href="#">Five</a></li>
</ul>
@isGabe
isGabe / GrunticonSetup.markdown
Last active December 17, 2015 23:49
Grunticon Setup

Basic Grunticon Setup for CLI Idiots Like Me

I hacked and cursed my way to this point...better write it down!

  1. Install node.js: http://nodejs.org/
  2. Install grunt.js: http://gruntjs.com/getting-started
  3. In the Terminal: $ cd [directory]
  4. Either create package.json and use data in this gist's package.json, or run $ npm init and folow the steps
  5. Make sure to add "grunt": "latest" in devDependencies if you use npm-init to create the package.jason file
  6. Install Grunticon in the project: $ npm install --save-dev grunt-grunticon
  7. Create Gruntfile.js and use data from the Gruntfile.js in this gist. Tweak grunticon file paths as needed.
@isGabe
isGabe / cpt-archive-by-tax-term.php
Last active December 18, 2015 10:49
WordPress: CPT Archive Organized by Taxonomy Term #snippet #WordPress
<?php
$tax_name = 'tax_name';
$terms = get_terms($tax_name);
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
echo '<section class="' . $term->name . '">';
echo '<h2 class="section-title">' . $term->name . '</h2>';
echo '<ul>';
@isGabe
isGabe / acf-gallery-grid.php
Created June 13, 2013 21:34
WordPress: Output Avdanced Custom Fields Gallery Grid #WordPress #snippet
@isGabe
isGabe / mobile-menu-toggle.js
Created June 13, 2013 22:42
jQuery/CSS: Basic mobile menu toggle using, with nested CSS toggle for dropdowns
$('#menu-main-menu').slideToggle(200);
});
$('#menu-main-menu > li.menu-item-parent > a').click(function(e){
$(this).parent().toggleClass('open');
$(this).preventDefault();
});
@isGabe
isGabe / menu-item-parent-class.php
Created June 13, 2013 22:47
WordPress: Add 'menu-item-parent' to menu lis that contain submenus #WordPress #snippet
/**
* Set our new walker only if a menu is assigned,
* and a child theme hasn't modified it to one level deep
*/
function fstop_nav_menu_args( $args ) {
if ( 1 !== $args[ 'depth' ] && has_nav_menu( 'main-nav' ) ) {
$args[ 'walker' ] = new FStop_Page_Navigation_Walker;
}
return $args;
}
@isGabe
isGabe / widgets.php
Created June 17, 2013 20:25
Basic WordPress Widget Code #snippet #WordPress
<?php
/*
* Basic WordPress Widget Code
* Save to: /wp-content/theme/widgets.php
* in functions.php or appropriate place: if ($wp_version >= 2.8) require_once(TEMPLATEPATH.'/widgets.php');
*
*/
class MyWidgetName extends WP_Widget
{
@isGabe
isGabe / wp-attachment-gallery.php
Created July 4, 2013 19:27
WordPress: Output all attached images as a gallery #snippet #WordPress
@isGabe
isGabe / wp-pagination.php
Created August 7, 2013 04:37
WordPress: Pagination #snippets #WordPress
<?php
// Numeric Page Navigation
function bones_page_navi() {
global $wp_query;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 )
return;
echo '<nav class="pagination">';
@isGabe
isGabe / Gruntfile.js
Last active December 21, 2015 13:39
basic grunt files for Compass, SASS, and concatenating and minifying JS
module.exports = function(grunt) {
grunt.initConfig({
watch: {
css: {
files: '**/*.scss',
tasks: ['compass'],
},
},
compass: { // Task
dist: { // Target