query{
products(first: 100, query: "tag:vans AND title:AUTHENTIC") {
edges {
node {
id
title
tags
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 React, { useEffect, useRef, useState } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
interface Options { | |
enable?: boolean; | |
target?: GlobalEventHandlers; | |
} | |
const useEventListener = ( | |
targetEvent: keyof GlobalEventHandlersEventMap, |
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
const p1 = new Promise((resolve, reject) => setTimeout(resolve(1), 200)) | |
const p2 = new Promise((resolve, reject) => setTimeout(reject('error'), 300)) | |
const p3 = new Promise((resolve, reject) => setTimeout(resolve(3), 4000)) | |
Promise.all([p1, p2, p3]).then((res) => console.log(res)).catch(e => console.log(e)) | |
Promise.allSettled([p1, p2, p3]).then((res) => console.log(res)).catch(e => console.log(e)) |
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 React, { useCallback } from 'react' | |
import { DropZone, MediaCard } from '@shopify/polaris' | |
const ImageUploadDropZone = ({ files, setFiles }) => { | |
const handleDropZoneDrop = useCallback( | |
(_dropFiles) => setFiles([..._dropFiles]), | |
[] | |
) | |
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png'] |
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
<?php // /app/Http/Middleware/Cors.php | |
namespace App\Http\Middleware; | |
use Closure; | |
class Cors { | |
public function handle($request, Closure $next) | |
{ | |
return $next($request) |
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
const zipInput = document.getElementById("checkout_shipping_address_zip") | |
const numberInput = document.getElementById("checkout_shipping_address_phone") | |
const submitButton = document.getElementById('continue_button') | |
const submitText = submitButton.children[0] | |
let zipError = document.createElement('p') | |
zipError.setAttribute('id', 'error-for-zip') | |
zipError.setAttribute('class', 'field__message field__message--error') | |
zipError.innerHTML = "日本の有効な郵便番号を入力してください" |
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
document.addEventListener('DOMContentLoaded', function(){ | |
const list = document.querySelector('#book-list ul'); | |
const forms = document.forms; | |
// delete books | |
list.addEventListener('click', (e) => { | |
if(e.target.className == 'delete'){ | |
const li = e.target.parentElement; | |
li.parentNode.removeChild(li); |
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
/** | |
* Created by kushal | |
* | |
* Usage : | |
* To access local system webcam on the internet/ | |
* Couple of points to be remembered: | |
* | |
* - Accessing the webcam using HTML5 and JS requires permission from | |
* the browser. The url of the file has to be a valid one. Url such as file:/// in your browser will not permit the browser to access local webcam. | |
* - Whereas, an http or https url will surely make a paved way for it. Hence, while developing, one can use Xampp, Wamp or the LAMP Stack. |