Skip to content

Instantly share code, notes, and snippets.

View jimmynotjim's full-sized avatar
☀️
Enjoying SoCal "Fall"

Jimmy Wilson jimmynotjim

☀️
Enjoying SoCal "Fall"
View GitHub Profile
@jimmynotjim
jimmynotjim / gist:3724006
Created September 14, 2012 19:04
Use Modernizr and jQuery to show a loading gif while an iframe loads
<?php
$ig_post_custom_fields = array (
"infographic" => array(
"name" => "is_infographic",
"std" => "",
"title" => "Is this an infographic post?",
"description" => "If you check this box, we'll add a Pin It share option.",
"type" => "checkbox"),
"image_url" => array(
@jimmynotjim
jimmynotjim / click event
Created December 7, 2012 13:41
Dropdown menu script
// This doesn't work when tapping off the menu, but works when clicking off the menu on non-touch (desktop)
/* Main Mobile Nav */
$(document).ready(function(){
var trigger = $('.menu-trigger');
var nav = $('.main-nav');
var parItem = nav.find('.parent-item > a');
var subMenus = nav.find('.sub-menu');
@jimmynotjim
jimmynotjim / gist:4364092
Created December 23, 2012 16:13
My typical arsenal of SCSS mixins
// Mixins.scss
// Snippets of reusable CSS to develop faster and keep code readable
// -----------------------------------------------------------------
// UTILITY MIXINS
// --------------------------------------------------
// Webkit-style focus
// ------------------
@mixin tab-focus() {
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title></title>
<!-- iPhone -->
<link href="http://taylor.fausak.me/static/images/apple-touch-icon-57x57.png"
- simple
- public over private
- personal vanity
- internet is global
- permalinks
- one important item per page
- don't break the browser
- don't wanker in technology
- a medium is not a grande
- break convention for your users
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Last edited by Ukelele version 2.1.10 on 2012-07-12 at 12:43 (EDT)-->
<keyboard group="0" id="5593" name="U.S. Custom" maxout="1">
<layouts>
<layout first="0" last="17" modifiers="f4" mapSet="16c"/>
<layout first="18" last="18" modifiers="f4" mapSet="984"/>
<layout first="21" last="23" modifiers="f4" mapSet="984"/>
<layout first="30" last="30" modifiers="f4" mapSet="984"/>
<layout first="194" last="194" modifiers="f4" mapSet="984"/>
@jimmynotjim
jimmynotjim / taxonomy
Created February 1, 2013 16:23
Category function for metaboxes
/**
* Taxonomy show_on filter
* @author Bill Erickson
* @link https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Adding-your-own-show_on-filters
*
* @param bool $display
* @param array $metabox
* @return bool display metabox
*/
<?php
/* =BEGIN: Check If Page Is Parent/Child/Ancestor
Source: http://www.stemlegal.com/greenhouse/2012/checking-ancestor-and-parent-pages-in-wordpress/
---------------------------------------------------------------------------------------------------- */
function is_tree( $page_id_or_slug ) {
global $post;
if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/
$page = get_page_by_path( $page_id_or_slug );
$page_id_or_slug = $page->ID;