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
const shopName = window.Shopify.shop.replace(".myshopify.com", ""); | |
const { rtyp: resourceType, rid: resourceId } = window.__st; | |
if (["product", "collection", "page", "article"].includes(resourceType)) { | |
const url = `https://admin.shopify.com/store/${shopName}/${resourceType}s/${resourceId}`; | |
window.open(url, "_blank"); | |
} else { | |
alert("Unsupported resource type"); | |
} |
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
const shopName = window.Shopify.shop.replace(".myshopify.com", ""); | |
const themeId = window.Shopify.theme.id; | |
let previewPath = ""; | |
if (window.location.pathname !== "/") { | |
previewPath = encodeURIComponent(window.location.pathname); | |
} | |
const customizerUrl = `https://admin.shopify.com/store/${shopName}/themes/${themeId}/editor?previewPath=${previewPath}`; | |
window.open(customizerUrl, '_blank'); |
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
/** | |
* Quickly unfollow and remove from connections | |
* the LinkedIn connection you're currently viewing | |
* | |
* Enter the source code in browser Dev Tools or | |
* bookmark the bookmarlet version for one-click solution | |
*/ | |
/* Source Code Start */ | |
const actionsWrapper = document.querySelector('#main .pvs-profile-actions > *:last-child > div'); |
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
{% comment %} | |
Get page handle based on page type | |
{% endcomment %} | |
{% liquid | |
assign page_handle = '' | |
assign page_type = request.page_type | |
case page_type | |
when 'index' | |
assign page_handle = 'index' |
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
{% comment %} | |
Logic to ignore a tag in the loop, based on a provided set of comma separated tags. | |
@param settings.ignore_tags Comma separated tags to ignore | |
{% endcomment %} | |
{% liquid | |
assign can_ignore_tag = false | |
assign tag_handle = tag | handle | |
assign tags_to_ignore = settings.ignore_tags | split: ',' |
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
const twoSum = (numbers, target) => { | |
let indices = []; | |
for (let i = 0; i < numbers.length; i++) { | |
for (let j = 0; j < numbers.length; j++) { | |
if (i == j) { | |
continue; | |
} | |
if ((numbers[i] + numbers[j]) == target) { |
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
{% comment %} We assume that we have the youtube video in form of URL {% endcomment %} | |
{% assign video_url = 'https://www.youtube.com/watch?v=ScMzIvxBSi4' %} | |
{% assign thumbnail_url = '' %} | |
{% comment %} First of all, we get last part of the URL that's supposedly the Youtube Video ID {% endcomment %} | |
{% assign video_id = video_url | split: '/' | last %} | |
{% comment %} but we need strip any extra URL params {% endcomment %} | |
{% assign video_id = video_id | split: '?' | first %} |
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
/* | |
This script will scrape and display the doctors (available on a search page) information in the browser console. | |
Example search results page: https://findadentist.ada.org/search-results?address=22060 | |
How to use: | |
1. Search for doctors on https://findadentist.ada.org | |
2. When you get a list of doctors for your search criteria, open browser developer console | |
How to open console in Firefox: https://developer.mozilla.org/en-US/docs/Tools/Browser_Console#Opening_the_Browser_Console | |
How to open Console in Chrome: https://developers.google.com/web/tools/chrome-devtools/console/ |
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
$.extend(Tipped.Behaviors, { | |
'custom-speed': { | |
fadeIn: 250, | |
fadeOut: 250 | |
} | |
}); | |
Tipped.create('.tippy', { | |
behavior: 'custom-speed', | |
size: 'large' |
NewerOlder