Skip to content

Instantly share code, notes, and snippets.

View wesleyalmd's full-sized avatar

Wesley Almeida wesleyalmd

  • São Paulo, Brazil
View GitHub Profile
// @ts-nocheck
import fetch from "cross-fetch";
const pagarme_api_key = process.env.PAGARME_API_KEY;
const pagarme_endpoint = "https://api.pagar.me/core/v5";
const pagarme_headers = {
Authorization:
"Basic " + Buffer.from(`${pagarme_api_key}:`).toString("base64"),
"Content-Type": "application/json",
######## PWA Studio Environment Variables ######################################
#
# This file contains environment variables for a Magento PWA Studio project.
# PWA Studio uses environment variables for all variable cross-project
# values, so that a developer or a build system can override any variable
# with standard tools.
#
# This file belongs at the root of the PWA, and must be named `.env`.
# Uncomment and modify variable declarations in this file and they will take
# effect throughout the Buildpack tool chain.
query getEventProduct($url_key: String!) {
products(filter: { url_key: { eq: $url_key } }) {
items {
related_products {
id
name
sku
small_image {
url
}
@wesleyalmd
wesleyalmd / gist:886732150c8c336d75563f280db7a701
Created January 23, 2023 19:04
graphql - get events running land
query getProductsBySku {
products(
filter: {
sku: {
in: [
"GPR2023-SP"
"Brinde 2022 - Funcionários"
"CPR23SP2-MANIACS-SSA"
"MFR23FL1-42KFLORIPA-MANIACS-SSA"
"MRJ23RJ1-SSA"
# This file describes an application. You can have multiple applications
# in the same project.
# The name of this app. Must be unique within a project.
name: PROJECT_NAME
# The toolstack used to build the application.
type: php:7.4
build:
flavor: composer
mkdir packages && cd packages && \
git clone [email protected]:castletech/pwa-language-brazil.git \
&& cd pwa-language-brazil && git checkout develop && cd ../ && \
git clone [email protected]:castletech/pwa-module-core.git \
&& cd pwa-module-core && git checkout develop && cd ../ && \
git clone [email protected]:castletech/pwa-module-ozone.git \
&& cd pwa-module-ozone && git checkout develop && cd ../ && \
git clone [email protected]:castletech/pwa-module-automatic-related.git \
&& cd pwa-module-automatic-related && git checkout develop && cd ../ && \
git clone [email protected]:castletech/pwa-module-blog.git \
@wesleyalmd
wesleyalmd / schemas.graphqls
Created June 1, 2022 18:20
webkulmarketplaceapi
type Query {
marketplaceLangingPage: MarketplaceLangingPage @resolver(class: "Webkul\\MpApi\\Model\\Resolver\\LandingPage") @doc(description: "This Will Return Query of the marketpalce landing page")
sellersList(
filter: SellerFilters @doc(description: "Identifies which seller attributes to search for and return.")
): SellersList @resolver(class:"Webkul\\MpApi\\Model\\Resolver\\SellerList") @doc(description: "Return query of marketplace sellers list")
getSellerReview (
id: Int @doc(description: "Seller unique ID")
): SellerReview @resolver(class:"Webkul\\MpApi\\Model\\Resolver\\SellerReviews") @doc(description: "Returns particular seller's review")
@wesleyalmd
wesleyalmd / o2-calendario.md
Created November 22, 2021 15:23
O2 Calendario

definir URL do back como global para recuperar valor no front para montar inicio de URLs

process.env.BACKEND_URL

caso precise montar url dinamica de calendário

process.env.BACKEND_URL + /calendario.html?city=São+Paulo

query {
  storeConfig {
 product_url_suffix
@wesleyalmd
wesleyalmd / eventProduct.json
Created August 16, 2021 19:29
Running Land - Event Page Mock
{
"__typename": "SimpleProduct",
"meta_title": "Circuito das Estações 20/21 - Inverno - São Paulo",
"meta_description": "Circuito das Estações 20/21 - Inverno - São Paulo O Circuito das Estações é sinônimo de Corrida de Rua no Brasil. É o maior Circuito da América Latina e o principal responsável por despertar o corredor dentro de cada um. São 4 etapas, cada uma representan",
"event": 1,
"event_state": "SP",
"event_city": "São Paulo",
"name": "Circuito das Estações 20/21 - Inverno - São Paulo",
"description": {
"__typename": "ComplexTextValue",
@wesleyalmd
wesleyalmd / eventCategory.json
Created August 16, 2021 19:28
Running Land - Event Category Mock
{
"category": {
"__typename": "CategoryTree",
"id": 28,
"meta_title": null,
"meta_keywords": null,
"meta_description": null
},
"products": {
"__typename": "Products",