Skip to content

Instantly share code, notes, and snippets.

Avatar

Ilias Haddad IliasHad

View GitHub Profile
View checkout.liquid
{% if checkout.shipping_method.title == 'BNPL' %}
<script>
document.body.innerHTML = "Commande {{ order.name }}<center>Redirection vers la plateforme eProgram <br> Vous pourrez demander votre facilité de paiement ";
const queryString = window.location.search
const urlParams = new URLSearchParams(queryString);
if(urlParams.get('done')) {
fetch("https://eprogram-bnpl-app.herokuapp.com/api/request", {
"method": "PUT",
"headers": {
View gist:d5ddc69e6d02a5899987cee3267383d9
curl --request POST \
--url http://sandbox.nuitee.com/nuitee/2.0/booking/search \
--header 'Accept: application/json' \
--header 'ApiKey: othmaneTest' \
--header 'Authorization: signature=22e6b8d81a8a69c6836485e4cbf08a0417e0e3e87c0c10ba5b1b38e8d8e869e3a8cabbff30ea499c69774613d2c76f612cc062db1a61635c721b4e3bb6cbfdfe, timestamp=1639043026' \
--header 'Content-Type: application/json' \
--data '{"checkInDate":"2022-01-01","checkOutDate":"2022-01-02","hotelCodes":[494653,514024,494966,686474,566127,3603684,774246,109312,332546,332277,332500,596041,669835,2681534,344421,563735,964273,642209,563633,1560508,1700095123,486520,2079085,254355,1789113,811666,492852,402490,301157,1700021403,528369,997290,340698,686156,320161,878816,423808,995716,2100430,1789358,1052113,2099814,301732,401525,233135,402279,1737359,986284,323372,696983,581801,233388,1700018467,228106,246284,985533,505814,1001596,309908,495030,1680549,1887571,627966,1700037374,494645,1836798,274542,510933,747004,704645,3670136,233902,265401,702240
View gist:43a3ab86eb6755bae03a89c3042d7397
<div >
<button onclick="openTabs('Description')">Description</button>
<button onclick="openTabs('Reviews')">Reviews</button>
<button onclick="openTabs('Shipping')">Shipping Policy</button>
</div>
<div style="margin:10px 0;" id="Description" class="tab">
<h2>Description</h2>
{{ product.description }}
</div>
View page.about-us.liquid
<div class="page-width">
<div class="grid">
<div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth">
<div class="section-header text-center">
<h1>{{ page.title }}</h1>
</div>
<div class="rte">
{% capture view %}{%- render 'querystring', param: "refer" -%}{% endcapture %}
View querystring.liquid
{%- capture contentForQuerystring -%}{{ content_for_header }}{%- endcapture -%}
{%- assign pageUrl = contentForQuerystring | split:'"pageurl":"' | last | split:'"' | first | split:'.myshopify.com' | last |
replace:'\/','/' |
replace:'%20',' ' |
replace:'\u0026','&'
-%}
{%- assign itemShow = '' -%}
{%- for i in (1..1) -%}
{%- unless pageUrl contains "?" -%}{% break %}{%- endunless -%}
{%- assign pageQuerystring = pageUrl | split:'?' | last -%}
View page.private-deals.liquid
{% capture code %}{%- render 'querystring', param: "code" -%}{% endcapture %}
{% if code == "iliashaddad"%}
<div class="page-width">
<div class="grid">
<div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth">
<div class="section-header text-center">
View index.js
import React, { useState, useEffect } from "react"
import { Link } from "gatsby"
import Layout from "../components/layout"
import SEO from "../components/seo"
import Img from "gatsby-image"
const IndexPage = ({ data }) => {
const [posts, setPosts] = useState([])
useEffect(() => {
setPosts(data.allGoogleSheetSheet1Row.nodes)
}, [])
View gatsby-node.js
const { createRemoteFileNode } = require("gatsby-source-filesystem")
exports.onCreateNode = async ({
node,
actions,
store,
cache,
createNodeId,
}) => {
const { createNode } = actions
if (node.internal.type === "googleSheetSheet1Row") {
View gatsby-config.js
{
resolve: 'gatsby-source-google-sheets',
options: {
spreadsheetId: 'get this from the sheet url', worksheetTitle: 'ie the name in the worksheet tab', credentials: require('./secret.json')
}
}
@IliasHad
IliasHad / product.js
Created Apr 21, 2020
How to Gatsby Image in Strapi Multiple Image
View product.js
query {
strapiProducts(slug: { eq: ""}) {
title
description
images {
localFile {
childImageSharp {
fixed(height: 100, width: 100, quality: 100) {
...GatsbyImageSharpFixed