Skip to content

Instantly share code, notes, and snippets.

View stuartchaney's full-sized avatar
💥

Stuart Chaney stuartchaney

💥
View GitHub Profile
View gist:902ad58f081b975d8e09cd970cd428a4
<script src="https://cdn.tapcart.com/webbridge-sdk/webbridge.umd.js" defer></script>
<script type="text/javascript">
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "<%= asset_url('app_proxy/application') %>";
document.head.appendChild(script);
document.addEventListener("webbridge-loaded", function() {
const div = document.getElementById('rivo-app-root');
@stuartchaney
stuartchaney / determine_test_transaction.rb
Created August 10, 2023 15:07
Service object to determine test transactions for a Shop
View determine_test_transaction.rb
class DetermineTestTransaction < ApplicationService
attr_reader :shop
def initialize(shop)
@shop = shop
end
def perform
is_test_environment? || test_eligible_shop?
View gist:aa57afb1b01097588399361ae4af1a4e
time_ago = 1.day.ago
expected_customer_ids = s.orders.where(fulfillment_status: "fulfilled", remote_updated_at: time_ago..).pluck(:customer_id).uniq
actual_customer_ids = s.points_logs.where(applied_at: time_ago..).pluck(:customer_id).uniq
missing = expected_customer_ids - actual_customer_ids
######
ids = [6710280782089, 6509421658377, 6710941188361, 6711069212937, 6509565411593, 6711239704841, 6508219203849]
View potential-points-manual.liquid
{% comment %}{% assign icon_url = %}{% endcomment %}
{%- assign potential_points_config = shop.metafields.ba_loy.config.frontend.potential_points.order_placed -%}
{%- if potential_points_config.enabled && template.name == "product" -%}
{%- if potential_points_config.points_type == "multipler" -%}
{%- assign potential_points = product.price | divided_by: 100 | times: potential_points_config.points_amount -%}
{%- else -%}
{%- assign potential_points = potential_points_config.points_amount -%}
{%- endif -%}
View gist:865099c5994b6486f1266bb9f6efa938
<div class="rivo-reviews-star-rating" data-product-id="{{ product.id }}" data-rating="{{ product.metafields.ba_rev.review_data.stars }}" data-count="{{ product.metafields.ba_rev.review_data.reviews_count }}">
<div class="rivo-reviews-rating-count"></div>
</div>
View custom.css
.modules-wrapper span .panel--module{
box-shadow: 4px 4px 0px 0px #000;
}
View gist:a297d8532a5f7d7cf72068731f08c233
create_table "app_events", id: false, force: :cascade do |t|
t.bigserial "id", null: false
t.bigint "shop_id"
t.string "shopify_domain"
t.string "app_type"
t.datetime "remote_date_at"
t.string "name"
t.string "details"
t.datetime "billing_on"
t.datetime "created_at", null: false
@stuartchaney
stuartchaney / keybase.md
Created January 2, 2018 17:50
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am stuartchaney on github.
  • I am stuartchaney (https://keybase.io/stuartchaney) on keybase.
  • I have a public key whose fingerprint is 3AEB 0C0D 2538 14B5 EC23 549F 1876 64E8 A29C 88ED

To claim this, I am signing this object:

View gist:971ec47988b5ffbf53f54e0d4189e269
1. a) replace variable.price with wh_price
b) DO NOT replace inside of script tags
c) Only replace if inside {{ }} or {% %}
{{variable.price}} <!-- replace this with --> {{wh_price}}
{{random_stuff | times: 1 | variable.price}} <!-- replace this with --> {{random_stuff | times: 1 | wh_price}}
{% variable.price %} <!-- replace this with --> {% wh_price %}
<script type="text/javascript">
{{variable.price}} <!-- DONT REPLACE THIS -->
View gist:bcebbdd895a429c96e1c
### Keybase proof
I hereby claim:
* I am stuartchaney on github.
* I am stuartchaney (https://keybase.io/stuartchaney) on keybase.
* I have a public key whose fingerprint is 73B2 2335 3937 6F8C BF7F AE00 923F 0873 A974 3382
To claim this, I am signing this object: