Skip to content

Instantly share code, notes, and snippets.

View julesbravo's full-sized avatar

James Bathgate julesbravo

  • Postscript
  • San Antonio, TX
View GitHub Profile
@julesbravo
julesbravo / check-headless-shopify.min.js
Last active February 1, 2024 21:02
JS to check if a Shopify site is headless
!function(){let e=0;if(window?.__remixContext?.state?.loaderData?.root?.analytics?.shopifySalesChannel==="hydrogen"){alert("Is Headless (Hydrogen)");return}!window.Shopify&&e++,document.querySelectorAll('link[href^="https://cdn.shopify.com/oxygen"]').length>0&&e++,window.__remixContext&&e++,document.querySelectorAll('script[src*="_nuxt"]').length>0&&e++,document.querySelectorAll('script[src*="_next"]').length>0&&e++,document.getElementById("___gatsby")&&e++,e>1?alert("Probably Headless"):e>0?alert("Maybe Headless"):alert("Probably Not Headless")}();
<!-- Stylesheet -->
<link rel="stylesheet" href="//cdn.searchspring.net/ajax_search/sites/h7hdij/css/h7hdij.css">
<!-- AutoComplete -->
<script type="text/ss-template" name="AutoComplete" target="[ss-autocomplete]">
<section class="quickSearchResults" ng-show="ac.visible">
<div ng-show="ac.terms" id="ss-ac-terms" class="searchSuggestion">
<ul>
<li ng-repeat="term in ac.terms | limitTo:4" ng-class="{'ss-active': term.active}">
@julesbravo
julesbravo / gurneys.xml
Created January 21, 2019 16:17
Gurneys Example CV3 Problem
<product inactive="false" out_of_season="false" tax_exempt="false" text_field="false" hidden="true" featured="false" new="false" comparable="false" google_checkout_exempt="false" content_only="false" is_donation="false" kit="false" allow_fractional_qty="false">
<SKU>02152</SKU>
<ProdID>38</ProdID>
<Name>Sweet Lightning Winter Squash </Name>
<URLName>sweet_lightning_winter_squash_</URLName>
<Description><![CDATA[1 to 1 1/2- lb. yellow fruits with orange spots and stripes make beautiful fall decorations and sumptuous desserts and baked dishes! Sweet Lightning is the perfect size for stuffing or roasting&mdash;makes excellent single or two-person servings. The perfect size to microwave--- simply cut off the top, scoop out the seeds, and microwave till flesh is soft! Very productive, stores well, sweet, stringless orange flesh. 100 DAYS.]]></Description>
<DescriptionHeader>Gorgeous, great tasting squash is perfect for fall decor, highly productive</DescriptionHeader>
<Keywords>Sweet Lightning Winte
@julesbravo
julesbravo / Generator.php
Created January 14, 2019 18:27
SearchSpring Generator.php
<?php
/**
* Helper to fetch all data and write feed
* Copyright (C) 2017 SearchSpring
*
* This file is part of SearchSpring/Feed.
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
@julesbravo
julesbravo / example.xml
Created March 16, 2018 19:22
Example Product XML for HomeSew.com
<Product>
<sku>LABEL4</sku>
<name><![CDATA[Made in USA - Nylon Woven Tags]]></name>
<url>http://www.homesew.com/Made-in-USA-Nylon-Woven-Tags/productinfo/LABEL4/</url>
<image_url>http://www.homesew.com/images/LABEL4.jpg</image_url>
<thumbnail_url>http://www.homesew.com/images/LABEL4T.jpg</thumbnail_url>
<description><![CDATA[ Give your projects or merchandise an extra touch of quality wih our new Made in the USA labels! Sew-in woven nylon, 3/4" X 1", in packs of 100 or 1,000. ]]></description>
<price>10.95</price>
<categories>
<category><![CDATA[Sewing/Labels/Custom Woven Labels]]></category>
[nsStream-1517-1]2018-02-15T22:50:04.125318337Z NOTICE: IDWORKERS ENV var not set, using default (5)
[nsStream-1517-1]2018-02-15T22:50:04.288509397Z Firing up 45 workers. Each worker will fetch up to 50 products.
[nsStream-1517-1]2018-02-15T22:50:04.904464399Z Domain detected: 1157836.restlets.api.netsuite.com
[nsStream-1517-1]2018-02-15T22:50:05.518961103Z Updated script: {"updated":true,"queued":614,"took":607}
[nsStream-1517-1]2018-02-15T22:50:06.272611380Z 0.00pps 0.74s avg ----------- page 0 received, had 1000 ids. Took: 0.740s (total from queue to finish: 0.747s) ( 25 requests still outstanding)------------
@julesbravo
julesbravo / barney-gifs.txt
Created June 12, 2017 14:54
Barney Stinson Gifts
I Request The Higest Of Fives
http://media0.giphy.com/media/1DfZvKmiELvtS/giphy.gif
Legen-WaitForIt-Dary
http://media.giphy.com/media/12slK3kRc9ps08/giphy.gif
Going In My Blog
http://media2.giphy.com/media/YSyb49n2kEkjm/giphy.gif
Mental Self High Five
@julesbravo
julesbravo / gist:3d2a7a6fa0250193f7e7eb550340a6ad
Created August 1, 2016 19:34
HubSpot Engagement Search Endpoint Parameters
{
"offset": 0,
"count": 250,
"sorts": [{
"property": "engagement.timestamp",
"order": "ASC"
}, {
"property": "engagement.id",
"order": "DESC"
}],
@julesbravo
julesbravo / 0_reuse_code.js
Created October 1, 2015 17:37
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
@julesbravo
julesbravo / gist:230bc2c89cd46d9db6a0
Created July 17, 2015 20:19
Autocomplete API Example Results
SearchSpring.Autocomplete.buildResults({
products: [
{
price: 10,
secureThumbnailImageUrl: "https://c715832.ssl.cf2.rackcdn.com/images/250/SHOEIACC.jpeg",
name: "Shoei - <em>Helmet</em> Mouthpieces",
caption: "",
sku: "SHOEIACC",
url: "http://www.btosports.com/p/SHOEIACC",
thumbnailImageUrl: "http://cdn.btosports.com/images/250/SHOEIACC.jpeg"