Skip to content

Instantly share code, notes, and snippets.

View ashukasma's full-sized avatar
🎯
Focusing

Ashish ashukasma

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Bootstrap Modals only - by shlomo hassid</title>
<script type='text/javascript' src='//code.jquery.com/jquery-1.11.0.js'></script>
<style type='text/css'>
[role="button"] {
cursor: pointer;
}
@ashukasma
ashukasma / Theme
Last active December 17, 2015 08:02
Sale Banner code
{% include 'black-friday-sale-banner' %}
@ashukasma
ashukasma / image.css
Created December 17, 2015 08:00
Shopify image cross fading
.grid-link__image-centered{
display:block;
position:relative;
.original{
opacity:1;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
}
var ajax = {};
ajax.x = function () {
if (typeof XMLHttpRequest !== 'undefined') {
return new XMLHttpRequest();
}
var versions = [
"MSXML2.XmlHttp.6.0",
"MSXML2.XmlHttp.5.0",
"MSXML2.XmlHttp.4.0",
"MSXML2.XmlHttp.3.0",
{% tablerow product in collection.products cols: 3 %}
<div class = "image">
<a href="{{ product.url | within: collection }}"
title="{{ product.title }}">
<img src="{{ product.images.first | product_img_url: 'small' }}"
alt="{{ product.title }}" /></a>
</div>
<div class = "details">
{"id":"08c8b5f2-5c66-c9e2-a487-d38c5b6bc42d","name":"cart issue","timestamp":1453716073907,"requests":[{"collectionId":"08c8b5f2-5c66-c9e2-a487-d38c5b6bc42d","id":"6be104e2-02ca-7024-083c-10a273e00ed3","name":"http://purplesageyarns.com/cart/change.js","description":"","url":"http://purplesageyarns.com/cart/change.js","method":"POST","headers":"","data":[{"key":"line","value":"1","type":"text"},{"key":"quantity","value":"19","type":"text"}],"dataMode":"params","timestamp":0,"responses":[],"version":2},{"collectionId":"08c8b5f2-5c66-c9e2-a487-d38c5b6bc42d","id":"7510e0ae-3ef8-1c60-8293-54f8767ce8a8","name":"http://purplesageyarns.com/cart/add.js","description":"","url":"http://purplesageyarns.com/cart/add.js","method":"POST","headers":"","data":[{"key":"id","value":"14566848771","type":"text"},{"key":"quantity","value":"1","type":"text"}],"dataMode":"params","timestamp":0,"responses":[],"version":2}]}
@ashukasma
ashukasma / gist:b5dabcd6d14117366174
Created March 20, 2016 01:10 — forked from dlindenkreuz/gist:a439ec4b939f0561d6d9
Shopify handleize function in JavaScript
// one-liner version
// retains latin-1 supplement chars as well as latin extended-a and latin extended-b
Shopify.handleize = function (str) {
return str.toLowerCase().replace(/[^\w\u00C0-\u024f]+/g, "-").replace(/^-+|-+$/g, "");
};
@ashukasma
ashukasma / Image Size
Last active April 11, 2017 17:05 — forked from mnuno10/Change Image By Size
Shopify
<picture>
<source media="(max-width: 480px)" srcset="{{ home_slideshow_large_image | asset_url }} 1x, {{ 'slideshow_1_1024x1024.jpg' | asset_url }} 2x">
<source media="(max-width: 640px)" srcset="{{ home_slideshow_grande_image | asset_url }} 1x, {{ 'slideshow_1_1024x1024.jpg' | asset_url }} 2x">
<source media="(max-width: 1024px)" srcset="{{ home_slideshow_1024_image | asset_url }} 1x, {{ 'slideshow_1.jpg' | asset_url }} 2x">
<img src="{% comment %}ly_asset_replace_for_[ home_slideshow_image | asset_url ]_begin{% endcomment %}{% assign ly_asset = home_slideshow_image %}{% include 'ly-asset' with ly_asset %}{{ ly_translation }}{% comment %}ly_asset_replace_end{% endcomment %}" alt="">
</picture>
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}
.parent:hover .child {
display: block;
-webkit-animation: fadeIn 1s;
animation: fadeIn 1s;
}
@-webkit-keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}