View accordion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
// accordion | |
$('.accordion_content').hide(); | |
$('.accordion_item header h2').on('click', function(){ | |
var accordionheader = $(this); | |
if (accordionheader.hasClass('accordion-open')) { | |
$('.accordion-open').removeClass('accordion-open'); | |
accordionheader.parent().next().slideUp(500); | |
} | |
else { |
View awsconvert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Custom Elastic Transcoder Script for Bang on a Can by Square Candy | |
# Check for valid input | |
[[ "$1" && "$2" && "$3" ]] || { printf "Missing command arguments.\nUsage: awsconvert [audio/video] file-name_base ext\n" >&2; exit 1; } | |
[[ $1 = audio || $1 = video ]] || { printf "First argument must be either 'audio' or 'video'\nUsage: awsconvert [audio/video] file-name_base ext\n" >&2; exit 2; } | |
[[ $2 != *[^a-z0-9\_-]* ]] || { printf "Error: filename argument must contain only lowercase letters, numbers, underscores and dashes.\nUsage: awsconvert [audio/video] file-name_base ext\n" >&2; exit 3; } | |
case "$1" in | |
'audio') |
View program.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p><em><strong>[SET TIMES ARE APPROXIMATE]</strong></em></p> | |
<h3>2:00pm</h3> | |
<div class="work"><span class="composer">Julia Wolfe</span> <em>Steel Hammer</em></div> | |
<p><span class="performer">Bang on a Can All-Stars with:<br>Emily Eagen, Katie Geissinger, Molly Quinn - voice</span></p> | |
<p><span class="location">Beaux Arts Court Stage</span></p> | |
<h3>3:30pm</h3> | |
<div class="work"><span class="composer">Innov Gnawa</span> works to be announced from stage</div> | |
<p><span class="performer">Innov Gnawa</span></p> | |
<p><span class="location">Beaux Arts Court Stage</span></p> | |
<h3>4:00pm</h3> |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
## This is what I want to do - create a straight meta_key ordering for search results - no SearchWP weights involved at all | |
// Modify the default blog page & archive queries | |
function squarecandy_modify_main_query( $query ) { | |
// main page / main blog query | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->query_vars['posts_per_page'] = -1; | |
$query->query_vars['orderby'] = 'meta_value_num'; |
View squarecandy-woocommerce-customizations.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Square Candy WooCommerce Customizations |
View gist:b30a253fa087c66bfe33e34f4e3df998
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
/** | |
* custom_woocommerce_template_loop_add_to_cart | |
*/ | |
function custom_woocommerce_product_add_to_cart_text() { | |
global $product; | |
$product_type = $product->get_type(); |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// account for conflicts between GiveWP Stripe AND WooCommerce Stripe script loading | |
function squarecandy_givewp_woocommerce_stripe_resolve() { | |
// check if both Stripe plugins are active | |
if ( is_plugin_active( 'woocommerce-gateway-stripe/woocommerce-gateway-stripe.php' ) && is_plugin_active( 'give-stripe/give-stripe.php' ) ) : | |
// deregister one of the copies of stripe-js | |
wp_deregister_script( 'give-stripe-js' ); | |
endif; | |
} | |
add_action( 'wp_enqueue_scripts', 'squarecandy_givewp_woocommerce_stripe_resolve', 9999999 ); |
View wpcf7-thankyou-per-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener( 'wpcf7mailsent', function(event) { | |
// console.log(event.detail.contactFormId, event); | |
switch( event.detail.contactFormId ) { | |
case "1234": | |
// thank you page for form ID 1234 "My Form 1" | |
location='https://example.com/form1/thank-you/'; | |
break; | |
case "1235": | |
// thank you page for form ID 1235 "My Form 2" | |
location='https://example.com/form2/thank-you/'; |
View debug-givewp.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Debug Give Wp | |
Plugin URI: https://gist.github.com/squarecandy/8ed8265bde0c39e42ab8a19c062bf534 | |
Description: Help discover where all of Give's action can plop in some content, and what all the filters do | |
Version: 1.0 | |
Author: Square Candy | |
Author URI: http://squarecandy.net | |
License: GPLv3 | |
License URI: http://www.gnu.org/licenses/gpl.txt |
OlderNewer