Skip to content

Instantly share code, notes, and snippets.


Michaël Gallego bakura10

  • Sapporo, Japan
View GitHub Profile
bakura10 / microdata-schema.liquid
Last active Sep 1, 2020
This is the last microdata-schema for our Shopify themes
View microdata-schema.liquid
{%- comment -%}
This snippet structures the micro-data using JSON-LD specification. Please note that for Product especially,
the schema often changes. We try to output as much info as possible, but Google may add new requirements over time,
or change the format of some info
{%- endcomment -%}
{%- if request.page_type == 'product' -%}
{%- assign days_product_price_valid_until = 10 | times: 86400 -%}
{%- assign gtin_option = 'gtin' -%}
View test.php
$variants = [];
foreach ($shopifyClient->getVariantsIterator(['fields' => 'id,inventory_quantity']) as $variant) {
$variants[$variant['id']] = $variant['inventory_quantity'];
foreach ($products as $index => $product) {
$delay = (int) ($index / 4);
if ($product['quantity'] === $variants[$product['id']] {
View test.php
foreach ($products as $index => $product) {
$this->messageQueue->push(new DelayedMessage('product.validate_stock', [
'product' => $product['id']
], $index);
bakura10 / instagram-patch.liquid
Created Jan 12, 2018
Update to fix the Instagram Section for Focal—premium Shopify theme
View instagram-patch.liquid
window.addEventListener("DOMContentLoaded",function(){var a=function(a){var e=new Date(1e3*a.created_time),t=e.getMonth(),n=e.getDate(),i=e.getFullYear(),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return a.created_time=r[t]+" "+n+", "+i,!0},e=function(e){var t={% raw %}'<div class="instagram-fix grid__cell 1/2 1/3--handheld-and-up 1/'+e.attr("data-images-per-row")+'--lap-and-up"><div class="instagram__image-wrapper" style="background-image: url({{image}})"><a href="{{link}}" target="_blank"><div class="instagram__overlay"><p class="instagram__caption">{{caption}}</p><time class="instagram__date">{{model.created_time}}</time></div></a></div></div>'{% endraw %};new Instafeed({get:"user",userId:"self",accessToken:e.attr("data-access-token"),sortBy:"most-recent",limit:e.attr("data-limit-images"),resolution:"standard_resolution",template:t,filter:$.proxy(a)}).run()};$(".index-module__instagram[data-access-token]").each(function(a,t){e($(t))})});
bakura10 / instagram-patch.liquid
Created Jan 12, 2018
Update to fix the Instagram Section for Kagami—premium Shopify theme
View instagram-patch.liquid
window.addEventListener("DOMContentLoaded",function(){var e=function(e,t){new Instafeed({get:"user",userId:"self",accessToken:e,sortBy:"most-recent",limit:t,resolution:"standard_resolution",template:{% raw %}'<div class="instagram__image-wrapper instagram-fix"><a href="{{link}}" style="background-image: url({{image}})" target="_blank"><div class="instagram__overlay"><p class="instagram__caption">{{caption}}</p><time class="instagram__date">{{model.created_time}}</time></div></a></div>'{% endraw %},after:function(){$("#instafeed-mobile").append($("#instafeed").html())},filter:$.proxy(function(e){var t=new Date(1e3*e.created_time);m=t.getMonth(),d=t.getDate(),y=t.getFullYear();var a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return e.created_time=a[m]+" "+d+", "+y,!0})}).run()};!function(t){var a=t.attr("data-instagram-access-token"),n=t.attr("data-twitter-username");a&&e(a,n?3:6)}($(".index-module__social"))});
.instagram__image-wrapper > a {
View gist:c43062615c175c5e79075a24d368c8e6

DISCLAIMER: this is not really only about slate, just rough ideas on what I'd like to see in Shopify and that could be achieved in JS.

Hi everyone,

I had a talk with @t-kelly a few days ago and I'd like to expand on an idea that should represent what Slate could be in the future or what are the main frustration points in developing Shopify Themes.


We're now trying to develop more and more complex themes, both for the theme stores and clients. We're always trying to push the boundaries of what is possible with Shopify.

View gist:afa21c88d05c25c36d67ffb85630b836
Pipeline events:
* add_product.pre
Theme could add messages to the pipeline:
ShopifyApi.Pipeline.addProduct(1234, 1).then(function(pipelineStatus, cart) {
// do things
View command.php
class SendSmsHandler
public function __invoke(SendSms $command)
if ($this->usageService->exceedsQuota($command->getShopDomain())) {
// Update
View foo.php
return array(
'service_manager' => array(
'aliases' => array(
'Zend\Authentication\AuthenticationService' => 'doctrine.authentication.orm_default'
View gist:8439705
$config = [
'router' => [
'routes' => [
'zfr-oauth2-server' => [
'chain_routes' => [
'type' => 'Hostname',
'options' => [
'route' => 'connect.saas-metrics.localhost'
You can’t perform that action at this time.