Skip to content

Instantly share code, notes, and snippets.

@adpcris
adpcris / bundles.liquid
Created November 29, 2018 13:03
Bundles Sections Settings Example
<div class="page-width">
</div>
{% schema %}
{
"name": "Section Bundle",
"class": "index-section",
"settings": [
{
"type": "text",
"id": "bundle_title",
@adpcris
adpcris / register.liquid
Created June 22, 2018 08:39
Sign Up form with Accept Marketing
<!-- /templates/customers/register.liquid -->
<h1 class="small--text-center">{{ 'customer.register.title' | t }}</h1>
<div class="form-register form-vertical">
{% form 'create_customer' %}
{{ form.errors | default_errors }}
<label for="FirstName" class="label--hidden">{{ 'customer.register.first_name' | t }}</label>
<input type="text" name="customer[first_name]" id="FirstName" placeholder="{{ 'customer.register.first_name' | t }}" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autocapitalize="words" autofocus>
@adpcris
adpcris / instagram.js
Created June 5, 2018 06:56
Instagram feed
Inspira.instagramFeed = function(){
/**
* 1. Get access to the clients account
* 2. Go to https://www.instagram.com/developer/ and register a new app
* 3. visit the following url to generate a token which can only read basic public info
* https://api.instagram.com/oauth/authorize/?client_id=[CLIENT ID]&redirect_uri=[REDIRECT URI]&response_type=token&scope=basic+public_content
* 4. After accepting the application auth using the clients account the token will be in the url
* 5. Paste the token into the token variable below
**/
@adpcris
adpcris / social-meta.liquid
Created March 22, 2018 09:17
Minimal SEO data for Shopify Stores
{% comment %}
Facebook and Pinterest Open Graph
Use the Facebook Open Graph Debugger for validation (and cache clearing)
- http://developers.facebook.com/tools/debug
Validate your Pinterest rich pins
- https://developers.pinterest.com/rich_pins/validator/
{% endcomment %}
<meta property="og:site_name" content="{{ shop.name }}" />
<meta property="og:url" content="{{ canonical_url }}" />
@adpcris
adpcris / facebook_like.html
Last active June 13, 2018 14:54
social share
<!-- Go the following url to create snippet: https://developers.facebook.com/docs/plugins/like-button/ -->
<!-- Add the following snippet (this is only an example the correct one will be provided on the link above) after the body opening tag -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.0&appId=765360350238456&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
@adpcris
adpcris / validateEmail.js
Created January 7, 2016 08:45
Validate Email
function validateEmail(email) {
var re = /\S+@\S+\.\S+/;
return re.test(email);
}
@adpcris
adpcris / custom_paginate.js
Created September 10, 2015 12:39
Pagination for js filters when there are more than 10 pages - not view more button
/* in filters.js find this bit
if(this.container_paging){
if(page_count>1){
$('.pagination').show();
} else{
$('.pagination').hide();
}
}
@adpcris
adpcris / styled_select_box.css
Created April 2, 2015 08:08
Example of styled select box with just CSS. Live example here: http://www.mychildrensboutique.co.uk/
select{
/* remove arrow */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
/* bootstrapify corners */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
@adpcris
adpcris / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console