This file contains hidden or 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
class BulkOperationMutation < ApplicationService | |
STAGE_UPLOAD_MUTATION = <<~'QUERY' | |
mutation($input: [StagedUploadInput!]!) { | |
stagedUploadsCreate(input: $input) { | |
stagedTargets { | |
url | |
resourceUrl | |
parameters { | |
name | |
value |
This file contains hidden or 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
"apps": { | |
"wishlist": { | |
"empty": { | |
"title": "Empty wishlist", | |
"description": "You have no products in your wishlist", | |
"link": "Start shopping" | |
}, | |
"share": { | |
"title_without_name": "Shared wishlist", |
This file contains hidden or 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 snippet hides the add to cart and selector from the wishlist page | |
document.addEventListener('DOMContentLoaded', () => { | |
const callback = () => { | |
Array.from(document.querySelectorAll('ooo-wl-select-option')).forEach((item) => item.style.display = 'none'); | |
Array.from(document.querySelectorAll('ooo-wl-button-add-to-cart')).forEach((item) => item.style.display = 'none'); | |
} | |
const observer = new MutationObserver(callback); | |
observer.observe(document.documentElement, { attributes: true, childList: true }); | |
}); |
This file contains hidden or 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 argparse # Library for parsing command-line arguments | |
import requests | |
import json | |
import logging # Library for logging messages | |
# Parsing command-line arguments | |
parser = argparse.ArgumentParser(description='Remove all variants from a given instance') | |
parser.add_argument('--instance', type=str, help='SubDomain of your QuablePIM', required=True) | |
parser.add_argument('--token', type=str, help='Access Token with full permissions', required=True) | |
args = parser.parse_args() |
This file contains hidden or 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
@api_version = "2024-07" | |
@store_url = "TODO" | |
@api_key = "TODO" | |
@password = "TODO" | |
def graphql_request(query, variables = {}) | |
query = { query: query, variables: variables }.to_json unless variables.empty? | |
url = URI.parse("https://#{@store_url}/admin/api/#{@api_version}/graphql.json") | |
https = Net::HTTP.new(url.host, url.port) | |
https.use_ssl = true |
This file contains hidden or 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
/* | |
File in mydata.csv is formatted as follow: | |
key1/key2,"value1" | |
key1/key2/key3,"value2" | |
key1/key2/key4,"value2" | |
*/ | |
$file = fopen("mydata.csv", "r"); | |
$data = fgetcsv($file); |
This file contains hidden or 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
require 'aws-sdk-ssm' | |
module Tasks::CheckEnvVariables | |
AVAILABLE_ENVS = %w[qa production].freeze | |
def self.perform | |
template = YAML.load_file('./template.yaml') | |
ssm_client = Aws::SSM::Client.new( | |
region: 'eu-west-3', | |
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']) |
NewerOlder