Skip to content

Instantly share code, notes, and snippets.

John Hartley johnbhartley

Block or report user

Report or block johnbhartley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jzeltman
jzeltman / hash-navigation
Created Jul 10, 2012
#hash based navigation pattern
View hash-navigation
<!DOCTYPE html>
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie7"> <![endif]-->
<!--[if IE 8 ]> <body class="ie8"> <![endif]-->
<!--[if IE 9 ]> <body class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" dir="ltr" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@stevegrunwell
stevegrunwell / brworkshop-cbus-2012.md
Created Jul 9, 2012
Build Responsively Workshop - July 9-10, 2012 - Columbus, OH
View brworkshop-cbus-2012.md

Build Responsively - July 9-10, 2012

Responsive Design 101

Semantic grid system: http://semantic.gs/

They'd love to see an analytics script to track how often people are resizing the browser

  • add resize listener to the window, send GA event
  • git://gist.github.com/3076998.git
@crtr0
crtr0 / client.js
Created Jun 8, 2012
A simple example of setting-up dynamic "rooms" for socket.io clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@johnbhartley
johnbhartley / kellum-method.css
Created Apr 19, 2012
Kellum Method Image Replacement
View kellum-method.css
.hide-text {
height: ;
width: ;
display: block;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@slevithan
slevithan / real-xregexp.js
Created Apr 4, 2012
Grammatical pattern for real numbers using XRegExp.build
View real-xregexp.js
// Creating a grammatical pattern for real numbers using XRegExp.build
/*
* Approach 1: Make all of the subpatterns reusable
*/
var lib = {
digit: /[0-9]/,
exponentIndicator: /[Ee]/,
digitSeparator: /[_,]/,
View gist:2044174
<?php
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
View wp-query-ref.php
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@jaygooby
jaygooby / strip_related_videos.php
Created Nov 4, 2011
Always put a rel=0 attribute on Youtube embedded videos so that related videos aren't shown at the end
View strip_related_videos.php
@billerickson
billerickson / gist:1321001
Created Oct 27, 2011
Only show images marked as Include in Rotator
View gist:1321001
<?php
add_filter( 'be_gallery_metabox_args', 'be_gallery_custom_args' );
/**
* Only show images marked as Include in Rotator
* @author Bill Erickson
* @link http://www.wordpress.org/extend/plugins/gallery-metabox
* @since 1.0
*
* @param array query $args
@Jonathonbyrd
Jonathonbyrd / CustomWidgetFile.php
Last active Mar 12, 2019
EMPTY WIDGET Plugin code to create a single widget in wordpress.
View CustomWidgetFile.php
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
You can’t perform that action at this time.