Skip to content

Instantly share code, notes, and snippets.

View andresgallo's full-sized avatar

Andres Gallo andresgallo

View GitHub Profile
<head>
<meta charset="{{#with charset}}{{this}}{{else}}UTF-8{{/with}}">
{{~#with meta}}{{this}}{{/with~}}
{{include "/articlesource/ArticleSource.hbs" this}}
<style type="text/css">{{include "/global/Colors.hbs" this}}</style>
<style type="text/css">{{include "/global/Typography.hbs" this}}</style>
<link data-cssvarsponyfill="true" class="Webpack-css" rel="stylesheet" href="{{cdn "/styleguide/All.min.css"}}">
@andresgallo
andresgallo / Fetch.js
Last active August 7, 2024 15:08
Fetch
((url) => {
fetch(url)
.then(function(response) {
return response.text()
})
.then(function(html) {
var parser = new DOMParser();
var doc = parser.parseFromString(html, "text/html");
console.log('HEREEEE', doc);
// this.innerHTML = doc.documentElement.innerHTML
{ "_exampleOnly" : true, "_template" : "/author/AuthorPage.hbs", "_wrapper" : false, "above" : [ ], "actions" : [ { "_template" : "/action-bar/ActionBar.hbs", "items" : [ { "_template" : "/twitter/intent/TwitterTweetButton.hbs", "body" : "Tweet", "hashtags" : "", "text" : "Amazon%20Pay%20Team", "url" : "https%3A%2F%2Fpay.amazon.com%2Famazon-pay-team" }, { "_template" : "/linkedin/LinkedInShareButton.hbs", "body" : "LinkedIn", "source" : "Amazon%20Pay%20-%20US", "summary" : "Amazon%20Pay%27s%20team%20of%20content%20editors%20and%20writers.", "title" : "Amazon%20Pay%20Team", "url" : "https%3A%2F%2Fpay.amazon.com%2Famazon-pay-team" } ] } ], "aside" : [ ], "authorSocialLinks" : [ ], "banner" : [ ], "below" : [ { "_styledTemplate" : "/page/list/PayTalks.hbs", "_template" : "/page/list/PageList.hbs", "anchorId" : "list-fd0000", "headerPaddingGap" : "0", "items" : [ { "_template" : "/page/promo/PagePromo.hbs", "authorImage" : [ { "_template" : "/image/Image.hbs", "alt" : "Pay_Logo_Insights._CB1560544342_.svg", "imag
const END_TIME_INRANGE = (
individual.endTime >= available.startTime ||
individual.endTime <= available.endTime
)
const START_TIME_INRANGE = (
individual.startTimeTime >= available.startTime ||
individual.startTimeTime <= available.endTime
)
if (START_TIME_INRANGE || END_TIME_INRANGE) {
<bsp-jw-player data-video-player class="JWVideoPlayer"
data-player="{{playerId}}"
data-media-id="{{mediaId}}"
data-video-title="{{videoTitle}}"
data-video-uuid="{{videoUuid}}"
data-video-file-type="{{videoFileType}}"
data-video-pauseads="{{pauseads}}"
{{#with orientation}} data-orientation="{{this}}" {{/with}}
{{#if poster}}{{#resize poster (not orientation otherwise="videoPosterPortrait" then="videoPoster")}} poster="{{src}}" {{/resize}}{{/if}}
{{#if autoplay}}autoplay{{/if}}
@andresgallo
andresgallo / regexs
Last active October 6, 2023 04:01
Format
\(format([^()"]*"[^()"]*[^()"]*"*)\)
@andresgallo
andresgallo / file
Last active September 27, 2023 13:36
{{#each (and tagNavigation tagNavigation.[0] then=tagNavigation otherwise=sectionNavigation)}}
<div class="SectionPage-sectionNavigation" data-align-{{#with ../sectionNavAlign}}{{this}}{{else}}center{{/with}} {{#if ../sectionNavInsidePageHeading}}data-inside-heading{{/if}} style="
--color-section-nav-background: {{#with ../sectionNavBgColor}}{{this}}{{else}}{{#if ../sectionNavInsidePageHeading}}transparent{{else}}#000000{{/if}}{{/with}};
--color-section-nav-text: {{#with ../sectionNavTextColor}}{{this}}{{else}}var(--color-primary-text-inverse){{/with}};
--color-section-nav-text-hover: {{#with ../sectionNavTextHoverColor}}{{this}}{{else}}var(--color-primary-text-inverse){{/with}};">
{{include "/navigation/SectionNavigation.hbs" this}}
</div>
{{/each}}
{{~#set
imageSizePrefix=(
not (eq enhancementAlignmentImageNoLeft "align-fullWidth") otherwise="large" then=(
not (eq enhancementAlignmentImageNoLeft "align-right") otherwise="small" then="medium"
)
)
imageSizeSuffix=(
not (eq imageOrientationDefLandscape "portrait") otherwise="4x6" then="nocrop"
)
~}}
var items = [
['sovrn-rail', 640, 300],
['sovrn-rail-sticky', 640, 0],
['sovrn-rail-home', 640, 300],
['sovrn-rail-sticky', 640, 0],
['sovrn-rail-home-sticky', 640, 0],
['sovrn-rail-hub', 640, 300],
['sovrn-rail-hub-large', 640, 300],
['sovrn-rail-hub-sticky', 640, 0],
['sovrn-rail-story', 640, 0],
((elAds, elLists) => {
elLists.forEach(elList => {
var elItems = elList.querySelectorAll('.PageList-items-item')
elItems.forEach((elItem, index) => {
elItem.insertAdjacentHTML('afterBegin', `<h1 style="opacity: 0.4;position: absolute;left: 0;">${index+1}</h1>`)
})
})
elAds.forEach(ad => {
ad.style.height = "100px";
ad.style.width = "100%"