Skip to content

Instantly share code, notes, and snippets.

View benjino's full-sized avatar

Ben Siegfried benjino

View GitHub Profile
@jamiemitchell
jamiemitchell / functions.php
Last active December 22, 2021 18:44
Add a Woocommerce cart icon with count in Genesis
<?php //* Do not include this opening php tag
//* Add Cart icon and count to header if WC is active
add_action( 'genesis_header', 'jmd_wc_cart_count' );
function jmd_wc_cart_count() {
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$count = WC()->cart->cart_contents_count;
@rafibomb
rafibomb / desktop menu partial
Created May 2, 2015 04:17
Using Interchange on a mega-menu
<nav class="mega-menu">
<div class="row collapse">
<div class="medium-3 columns">
<img src="assets/img/duality.png" alt="company logo">
</div>
<div class="medium-7 columns">
<ul class="button-group even-3">
<li><a href="#" class="button" data-dropdown="living" data-options="is_hover:true; hover_timeout:500">Living Room Furniture</a></li>
<li><a href="#" class="button" data-dropdown="bedroom" data-options="is_hover:true; hover_timeout:500">Bedroom Room Furniture</a></li>
<li><a href="#" class="button" data-dropdown="storage" data-options="is_hover:true; hover_timeout:500">Storage<br>Furniture</a></li>
@JGallardo
JGallardo / app.js
Last active December 20, 2015 03:49
Things that I have to nest for various cases for this responsive site.
/* -----------------------------------------
Global
----------------------------------------- */
$(window).load(checkWindowSize);
$(window).resize(checkWindowSize);
/*
function checkWindowSize() {
if ( $(window).width() < 380 ) {
$('div#footer ul li').addClass('button medium secondary expanded');
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')