Skip to content

Instantly share code, notes, and snippets.

@jmcclellan
jmcclellan / equal-height-columns.js
Created February 7, 2014 18:10
Use jQuery to create equal height columns
function setEqualHeight(columns) {
// define our variables
var tallestcolumn = 0;
var currentHeight = 0;
// .each() iterates over a jquery object (in this case our columns argument)
columns.each(
function() {
// assign currentHeight variable the height of the current DOM element in our loop
currentHeight = jQuery(this).height();
// is the currentHeight variable larger than the currentHeight variable?
@jmcclellan
jmcclellan / gist:5e7c1b45c2e832fcfba6
Created June 20, 2014 04:59
Call the Ustream Channel API to see if a channel is live
// CUSTOM CODE that checks ustream and displays banner if it's live
// GET URL represented as https://api.ustream.tv/channels/CHANNEL_ID.json
$.getJSON('https://api.ustream.tv/channels/5817556.json', function(data)
{
// if the channel status is live then do something
if (data.channel.status == 'live')
{
// alert('Its live!');
}
});
@jmcclellan
jmcclellan / script.js
Last active August 29, 2015 14:05
Open nav menu on hover instead of click when using the Roots framework
// add open class to dropdown menu when hovered over
$(function() {
$(".dropdown").hover(
function(){ $(this).addClass('open'); },
function(){ $(this).removeClass('open'); }
);
});
@jmcclellan
jmcclellan / wpseo_breadcrumb_links.php
Created September 28, 2014 01:18
Override Yoast SEO Breadcrumb Trail
Array
(
[0] => 479018
[1] => 470821
[2] => 470714
[3] => 470680
[4] => 470549
[5] => 470545
[6] => 470500
[7] => 470498
@jmcclellan
jmcclellan / Brewfile
Last active July 17, 2019 16:21
New Mac Setup
tap 'caskroom/cask'
tap 'caskroom/fonts'
brew 'git'
brew 'node'
brew 'zsh'
brew 'bash-completion'
brew 'python'
cask '1password'
cask 'agenda'