Skip to content

Instantly share code, notes, and snippets.

View milkbottlelough's full-sized avatar

Loughlin McSweeney milkbottlelough

View GitHub Profile
@milkbottlelough
milkbottlelough / tabs | tabbed-description.liquid
Last active April 11, 2022 17:53 — forked from tairli/tabbed-description.liquid
Tabs / Tabbed Product description snippet for Shopify
{% comment %}
if combine_pretext is false, the text before the first <h6> will be shown above all tabs, otherwise added to the first tab
{% endcomment %}
{% assign combine_pretext = false %}
{% assign description = tabbed-description | default: product.description %}
{% if description contains "<h6>" %}
{% assign tab_heads = '' %}
{% assign tab_texts = '' %}
{% assign pretext = '' %}
@milkbottlelough
milkbottlelough / html-head-boilerplate.html
Created October 20, 2019 10:09 — forked from nunosans/html-head-boilerplate.html
HTML Head Boilerplate & Reference
<!doctype html>
<html>
<head>
<!-- Priority tags. These must come first. -->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge; chrome=1"> <!-- Render Chrome if available or using latest version of Internet Explorer (Recommended). -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- Document Title -->
<title>Page Title</title>
<!-- Allows control over where resources are loaded from. Place as early in the document as possible, only applies to content below this tag. -->
var KlaviyoSubscribe = KlaviyoSubscribe || {};
(function() {
if (!KlaviyoSubscribe._loaded) {
KlaviyoSubscribe._loaded = !0;
var m = {
"modal.html": '<div class="klaviyo_modal" style="display:none;"><div class="klaviyo_inner"><a href="#" class="klaviyo_close_modal klaviyo_header_close">&times;</a><form action="" method="POST" novalidate="novalidate" class="klaviyo_subscription_form"><input type="hidden" name="g" value="" /><p class="klaviyo_header"></p><p class="klaviyo_subheader"></p><div class="klaviyo_fieldset"></div><div class="klaviyo_fine_print"></div><div class="klaviyo_form_actions"><button type="submit" class="klaviyo_submit_button"><span></span></button></div><div class="klaviyo_below_submit"></div><div class="error_message" style="display:none;"></div></form><div class="success_message" style="display:none;"></div></div></div>',
"flyout.html": '<div class="klaviyo_flyout" style="display:none;"><div class="klaviyo_inner"><div class="klaviyo_topbar" /><a href="#" class="klav
@milkbottlelough
milkbottlelough / pagespeed.php
Created March 30, 2020 11:32 — forked from typhonius/pagespeed.php
A PHP script to look up and parse google pagespeed results.
<?php
$url = 'URL GOES HERE';
$key = 'KEY GOES HERE';
// View https://developers.google.com/speed/docs/insights/v1/getting_started#before_starting to get a key
$data = json_decode(file_get_contents("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=$url&key=$key"));
$dat = $data->formattedResults->ruleResults;
foreach($dat as $d) {
$name = $d->localizedRuleName;
@milkbottlelough
milkbottlelough / checkout-random-products.css
Created March 23, 2021 10:40 — forked from xxxdepy/checkout-random-products.css
Script for Random Products Add to Cart on Shopify Checkout Page
/*
* Add to Cart module for Checkout
*/
.checkout-add-cart-module {
padding: 0px;
background-color: transparent;
margin-top: 30px;
@milkbottlelough
milkbottlelough / youtube-video-thumbnail.liquid
Last active January 25, 2023 14:21 — forked from junaidkbr/youtube-video-thumbnail.liquid
Get Youtube video thumbnail from Youtube URL in Shopify Liquid
{% assign video_url = 'https://www.youtube.com/watch?v=R5jIoLnL_nE' %}
{% assign thumbnail_url = '' %}
{% assign video_id = video_url | split: '/' | last %}
{% assign video_id = video_id | split: '?' | last %}
{% assign video_id = video_id | split: 'v=' | last %}
{% if video_id != blank %}
{% assign thumbnail_url = 'http://img.youtube.com/vi/' | append: video_id | append: '/maxresdefault.jpg' %}
{% endif %}