Skip to content

Instantly share code, notes, and snippets.

@jhummel
jhummel / tabs.js
Created December 19, 2016 19:50
Non-ADA Tabs
$(document).ready(function(){
$('ul.tabs li').click(function(){
var tab_id = $(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
@jhummel
jhummel / ada.coffee
Created December 19, 2016 19:48
ADA Tabs
class AccordianController
constructor: (view, options) ->
@$view = $ view
@options = $.extend
header: 'dt'
body: 'dd'
header_class: 'opened'
body_class: 'expanded'
single: false
, options || {}
@jhummel
jhummel / gist:98639dd9ec70f5a2e0df
Created November 5, 2014 03:59
Sample VIP Request in Node
var moment = require('moment');
var http = require('http');
var crypto = require('crypto');
function makeRequest(callback) {
var secret = '<SHARED SECRET>'
var id = '<CLIENT ID>'
var params = 'action=brands'
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: a5e73d44cba09a13e7536c0c665bf2a041410d88
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.9.2-x86_64
Xcode: 5.1.1
@jhummel
jhummel / Homebrew
Created October 30, 2013 21:54
Output for homebrew issue
humjay@humjay brew update
Already up-to-date.
humjay@humjay brew doctor
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install unixodbc
Run `brew missing` for more details.
@jhummel
jhummel / functions.php
Created September 19, 2013 16:53
Enqueue a stylesheet with conditional tags
function bones_scripts_and_styles() {
global $wp_styles; // <-- you need this
// ie-only style sheet
wp_register_style( 'ie-only', get_stylesheet_directory_uri() . '/path/to/ie.css', array(), '' );
wp_enqueue_style( 'ie-only' );
$wp_styles->add_data( 'bones-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet
}
@jhummel
jhummel / functions.php
Created September 15, 2013 22:36
Add plain text to a Wordpress menu
/* Create the ability to add plain text menu items.
* Add a new Custom Link with your text as the label, and put a "#" in the URL field.
* Add the item, and save your menu. This function will look for any anchor tags
* with a href="#" and strip them out leaving only the text.
*/
add_filter('walker_nav_menu_start_el', 'chlk_make_plain_text_menu_items');
function chlk_make_plain_text_menu_items($items) {
$xml = new DOMDocument();
$xml->loadHTML($items);
$application_icons: remove, add, checkout, print, export;
.with_icon {
background-position: left 48%;
background-repeat: no-repeat;
padding-left: 1.5em;
@include background-size(auto 90%);
@each $icon in $application_icons {
&.#{$icon} {
@jhummel
jhummel / gist:1338318
Created November 4, 2011 00:09
Make ujs-jquery for rails work with Zepto
// Fix to make zepto work with ujs-jquery
$.fn.ajaxSend = function(callback) {
return this.each(function(){
$(this).on('ajaxBeforeSend', callback);
});
};
var jQuery = $;
@jhummel
jhummel / gist:1259556
Created October 3, 2011 16:42
Converting Units
@function convert($start, $ratio: 10px/1em) {
@return $start/$ratio;
}
/* image is 50px tall */
convert(image-height('path/to/image.jpg')); => 5em;