Skip to content

Instantly share code, notes, and snippets.

# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples
@shopifypartners
shopifypartners / order-status-product.liquid
Last active January 19, 2023 15:20
Script to load specific content for a particular product, on the order status page - https://www.shopify.com/partners/blog/order-status-page
<script>
{% for line in checkout.line_items %}
<!-- DEBUG looking at {{ line.title }} -->
{% if line.title == 'Red Sports Tee' %}
Shopify.Checkout.OrderStatus.addContentBox(
'<h2>Thanks for your order</h2>',
'<p>Have a 10% discount on us! Use AWESOME18 with your next purchase</p>'
)
{% endif %}
{% endfor %}
@ethicka
ethicka / localhost-ssl-certificate.md
Last active February 18, 2024 16:29
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@blboyle
blboyle / gp_checkout_autocomplete.js
Created May 29, 2017 14:19
Constructor for Google Place Autocomplete
var GpCheckoutAutocomplete = (function() {
function GpCheckoutAutocomplete() {
this.enableGeolocate = false;
this.countryError = 'Please select valid country';
this.addressInput = 'shipping_address';
this.address1ErrorPlaceholder = 'Address';
this.authFailure = false;
this.googleMapsCircle = {};
this.boundsInterval = {};
this.componentForm = {};
@blboyle
blboyle / gp_settings_schema_addition
Created May 29, 2017 14:17
Add this to the bottom of your settings_scheme.json
,
{
"name": "Google Places Autocomplete",
"settings": [
{
"type": "header",
"content": "Google Places Autocomplete"
},
{
"type": "paragraph",
@ccashwell
ccashwell / getDiscountCode.html
Last active January 19, 2023 15:25
Autofill Discount Code from Shopify URL
<script>
/* Put this in theme.liquid, preferably right before "</body>" */
(function() {
var discountParam = document.location.search.match(/discount=(\w+)/);
if (discountParam && discountParam.length > 1) {
document.cookie = discountParam[0];
}
})();
</script>
<script>
Shopify.currentProduct = {{ product | json }};
if (Shopify.currentProduct) {
console.log(Shopify.currentProduct.variants);
}
</script>
@yomguy
yomguy / instafeed_tags.py
Last active November 22, 2017 15:34
Instafeed like django tag displaying an instagram gallery by hashtag (as a workaround since official API change in june 2016)
from django import template
import requests, json
register = template.Library()
@register.simple_tag
def instafeed(hashtag, count):
"""Simply use with autoescapeoff, for example: {% autoescape off %}{% instafeed 'manifeste16' 8 %}{% endautoescape %}"""
html = ''
@leonderijke
leonderijke / README.md
Last active January 19, 2023 15:18
Front Export: Little export script for exporting all conversations in a Front App inbox

Front export

✋ Heads up! This code uses the Front API V1, which is deprecated. @niklasravnsborg took this project further and created a Front API V2 compatible version: https://github.com/niklasravnsborg/front-export 🎉

Little export script for exporting all conversations in a Front inbox, using the Front API.

When using the awesome Front App, you want to export all conversations in an inbox. For example, for backup purposes.

Three environment variables are needed:

@mojaray2k
mojaray2k / instafeedjsaccess.md
Last active May 22, 2022 10:40
Getting Instagram Access Token for http://intafeedjs.com

#Use this URL to get your client authorized for Instafeed.JS plugin for Instagram.

  1. First login into your Instargam account
  2. Then go to https://www.instagram.com/developer/
  3. At the top click on the Button that says "Manage Clients".
  4. If you have not Register a new client.
  5. Fill out everything and where it says redirect url put this url: http://instafeedjs.com
  6. Then on the security tab make sure you uncheck "Disable implicit OAuth"
  7. Finally use this link to authoruize Instafeed. Where it says "[Client ID]" replace that including the brackets with your clientID from instagram:
  8. https://instagram.com/oauth/authorize/?client_id=[Client ID]&redirect_uri=http://instafeedjs.com&amp;response_type=token