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
<?php | |
/** | |
* Sourced from https://gist.github.com/Ellrion/f51ba0d40ae1d62eeae44fd1adf7b704 | |
*/ | |
class UnparsedURL | |
{ | |
private $parts; | |
public function __construct(array $parts){ | |
$this->parts = $parts; |
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
{ | |
"query": { | |
"bool": { | |
"must_not": { | |
"wildcard": { | |
"error.string": { | |
"value": "Some sort of value*" | |
} | |
} | |
} |
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
query ($uri: String!) { | |
wpPage(uri: { eq: $uri }) { | |
title | |
content | |
uri | |
slug | |
isFrontPage | |
wpFields { | |
homepage { | |
fieldGroupName |
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
import React, {useEffect, useRef, useState} from "react" | |
import {GatsbyImage, getImage} from "gatsby-plugin-image" | |
import {classNames} from "../../../../utils" | |
import Clamp from "react-multiline-clamp" | |
import parse from 'html-react-parser' | |
import {MinusSmIcon, PlusSmIcon} from "@heroicons/react/solid"; | |
export const Section = ({data, darken, side}) => { | |
const image = getImage(data.image?.localFile) ?? null | |
const bgClass = darken ? `bg-white` : `bg-white` |
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
{% if block.type == 'reviews' %} | |
<script> | |
document.querySelector('.spr-starrating').classList.add('cursor-pointer') | |
document.querySelector(`div.spr-summary-starrating`).onclick = function (e) { | |
Array.from(document.querySelectorAll('.sf-tab-header')).find(el => el.textContent.includes("Product reviews")).click(); | |
setTimeout(function(){ | |
document.querySelector('div[data-id="{{ product.id }}"]').scrollIntoView(); | |
}, 200) | |
} | |
</script> |
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
addEventListener('fetch', function (event) { | |
event.respondWith(handleRequest(event.request)); | |
}); | |
const pageType = (path: string): string|false => { | |
switch(path) | |
{ | |
case 'method': | |
return 'pages'; | |
case 'book-a-consultation': |
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
import fetch, {Headers} from 'node-fetch'; | |
import fs from 'fs'; | |
const headers = new Headers({ | |
"Authorization": "{your bearer token}{" | |
}); | |
const requestOptions = { | |
method: `GET`, | |
headers: headers, | |
redirect: `follow`, |
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
{ | |
"errors": [ | |
{ | |
"debugMessage": "Expected a value of type \"MenuLocationEnum\" but received: footer_1", | |
"message": "Internal server error", | |
"extensions": { | |
"category": "internal" | |
}, | |
"locations": [ | |
{ |
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
import fs from 'fs'; | |
import axios from 'axios'; | |
import axiosThrottle from 'axios-request-throttle'; | |
axiosThrottle.use(axios, {requestsPerSecond: 2}); | |
const domain = 'https://blah:blah@store.myshopify.com'; | |
const version = '2022-07' | |