This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: this gist is a part of this OSS project that I'm currently working on: https://github.com/steven-tey/dub | |
export default async function getTitleFromUrl (url: string) { | |
const controller = new AbortController(); | |
const timeoutId = setTimeout(() => controller.abort(), 2000); // timeout if it takes longer than 2 seconds | |
const title = await fetch(url, { signal: controller.signal }) | |
.then((res) => { | |
clearTimeout(timeoutId); | |
return res.text(); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure js-cookies are loaded before this code | |
function verifyAge(gaurdingPage = "./age-verification.html") { | |
if (!Cookies.get("age-verification")) | |
{ | |
Cookies.set("intended", window.location.href); | |
window.location.replace(gaurdingPage); | |
} | |
} | |
function checkAge(homePage = "./index.html", awayPage = "https://www.google.com/?q=") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div itemscope itemtype="http://schema.org/Product" id="ProductSection" data-section-id="{{ section.id }}" data-section-type="product-template" data-image-zoom-type="{{ section.settings.product_image_zoom_type }}" data-show-extra-tab="{{ section.settings.show_extra_tab }}" data-extra-tab-content="{{ section.settings.extra_tab_content }}" data-enable-history-state="true"> | |
{% case section.settings.add_to_cart_width %} | |
{% when 'small' %} | |
{%- assign btn_class = 'btn--wide' -%} | |
{%- assign productform_class = 'product-form--wide' -%} | |
{% when 'medium' %} | |
{%- assign btn_class = 'btn--wide' -%} | |
{%- assign productform_class = 'product-form--wide' -%} | |
{% when 'large' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ 'option_selection.js' | shopify_asset_url | script_tag }} | |
<script> | |
// <![CDATA[ | |
var selectCallback = function(variant, selector) { | |
if (variant) { | |
if (variant.available) { | |
// Selected a valid variant that is available. | |
$('#add-to-cart-button').removeClass('disabled').removeAttr('disabled').html('Add to Cart'); | |
} else { |
Simple floating CSS animation using transform and box-shadow.
A Pen by Joseph Martinez on CodePen.
- https://fishshell.com/ - my default shell, i use theme bobthefish
- https://www.sublimetext.com/ - my default editor
- Material Theme
- Operator font
- Packages: Emmet, Hayaku, SidebarEnhancements, JS Snippets, GSAP Snippets
- Sublime snippet for comments
- Sublime icon
- https://code.visualstudio.com/ - trying to switch, but not yet
NewerOlder