Skip to content

Instantly share code, notes, and snippets.

View bennick's full-sized avatar

Ryan Bennick bennick

View GitHub Profile
@bennick
bennick / content.html
Last active December 13, 2021 21:48
Content Link with Attributes
<div>
<span data-ms-show="auth">
<a href="https://customer.memberspace.com/content/public_id?display=inline">content</a>
</span>
<span data-ms-hide="auth">
This content is only available if you are a subscriber.
</span>
</div>
@bennick
bennick / members.js
Created September 22, 2021 20:33
Send members to their profile page
const handleMemberInfo = ({ detail }) => {
const { memberInfo } = detail;
if (memberInfo) {
window.location = `https://foundersummithq.webflow.io/members/${memberInfo.id}`
}
}
document.addEventListener('MemberSpace.member.info', handleMemberInfo);
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/bennick/.rvm/gems/ruby-2.7.2@memberspace/gems/puma-4.3.5/ext/puma_http11
/Users/bennick/.rvm/rubies/ruby-2.7.2/bin/ruby -I /Users/bennick/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20210118-53766-1ibe64v.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... yes
checking for SSL_CTX_set_min_proto_version in openssl/ssl.h... yes
@bennick
bennick / abcstore_module.php
Created December 12, 2013 01:05
An example of how to adjust the commission for one specific item in a referral's order.
<?php
class AbcStore_Module extends Core_ModuleBase
{
public function subscribeEvents()
{
Backend::$events->addEvent('threetwentynyaffiliate:onGetReferralCommission', $this, 'on_get_referral_commission');
}
public function on_get_referral_commission($referral, $original_commission)
@bennick
bennick / lemonstand_unique_products_post_click_listener.js
Created January 14, 2013 16:33
unique products blog post on lemonstand, click listener example
// Inside of click event listener
// Get image file name that is stored as the img id
var code = $(img_element).attr('id');
// Create an option and insert it into the select dropdown
$(product_option_select_dropdown).append("&lt;option value='" + code + "'&gt;" + code + "&lt;/option&gt;");
// Select the newly created option
$(product_option_select_dropdown).value = code;
@bennick
bennick / hidden_options.html
Created January 14, 2013 16:31
hidden products option select drop down
<div style="display:none;">
<span class="image_options_text"><?= h($option->name) ?>:</span>
<select name="<?= $control_name ?>">
<?
$values = $option->list_values();
foreach ($values as $value):
?>
<option <?= option_state($posted_value, $value) ?>
value="<?= h($value) ?>"><?= h($value) ?></option>
@bennick
bennick / create_action.js
Last active December 11, 2015 02:29
create action button listner
/*****************************/
/* Action for Create button */
/*****************************/
$("form#search_form").submit( function(event) {
event.preventDefault();
// get word from input form
word = $(this).children("input:text").val().toUpperCase();
word_len = word.length;
@bennick
bennick / grouped_products.php
Created January 14, 2013 16:27
grouped products for lemonstand unique product blog post
<? if ($product->grouped_products->count): ?>
< label style="display:none;" for="product_id"><?= h($product->grouped_menu_label) ?></label>
<select id="product_id" name="product_id" style="display:none;" onchange="$(this).getForm().submit()">
<? foreach ($product->grouped_products as $grouped_product): ?>
<option <?= option_state(post('product_id'), $grouped_product->id) ?>
value="<?= $grouped_product->id ?>">
<?= h($grouped_product->grouped_option_desc) ?>
</option>
<? endforeach ?>
</select>