Skip to content

Instantly share code, notes, and snippets.

View kagaim's full-sized avatar
🏠
Working from home

Erick Kagai kagaim

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<!--
Combining async await with fetch
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Putting User Input into JS Objects</title>
<style>
.formBox{
padding: 0.5rem 2rem;
@jonathanmoore
jonathanmoore / gist:c0e0e503aa732bf1c05b7a7be4230c61
Last active January 17, 2024 21:47 — forked from carolineschnapp/gist:1083007
Linked options helper methods for Shopify. See this: http://docs.shopify.com/manual/configuration/store-customization/advanced-navigation/linked-product-options - Updated to work with sectioned themes (tested with District)
<script>
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: mllegeorgesand@gmail.com
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus
// Modified by Jonathan Moore (Style Hatch) https://github.com/jonathanmoore
/*
Updated to work with sectioned themes
- Added required methods from the deprecated options_selection.js
- Triggers an initial variant change
- Hides sold out variants with only one option
@rickydazla
rickydazla / ajax-submit-form.js
Created December 10, 2015 03:13
Shopify AJAX Form submit
/* Build the Shopify Parameters
//---------------------------------------*/
var action = '/contact?';
action += encodeURIComponent('form_type') +'='+ encodeURIComponent('contact');
action += '&'+ encodeURIComponent('utf8') +'='+ encodeURIComponent('✓');
action += '&'+ encodeURIComponent('contact[email]') +'='+ encodeURIComponent(contact_email);
action += '&'+ encodeURIComponent('contact[body]') +'='+ encodeURIComponent(contact_body);
/* Submit the form
//---------------------------------------*/
@schaeken
schaeken / collection-sidebar.liquid
Last active November 18, 2021 13:40
Control the display order of tag groups lists in the collection sidebar using Supply's 'advanced tag filtering' - and control the sort order of the list items within that group using a link list.
<div class="grid-uniform">
{% assign group_array = settings.group_array | split: ',' %}
{% for group in group_array %}
{% if cat_array contains group %}
{% capture array %}{% unless array == blank or array == "" %}{{ array }},{% endunless %}{{group | strip}}{% endcapture%}
{% endif %}
{% endfor%}
{% assign cat_array = array | split:',' %}
{% comment %}
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};