This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
| // // with thanks | |
| // https://dev.to/emreloper/react-router-v6-in-two-minutes-2i96 | |
| // https://github.com/ReactTraining/react-router/blob/dev/docs/installation/getting-started.md | |
| // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9d29adedf662de685356f711951ef8b9e8342865/types/react-router/index.d.ts#L1 | |
| // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9d29adedf662de685356f711951ef8b9e8342865/types/react-router-dom/index.d.ts#L1 | |
| // // release notes | |
| // https://github.com/ReactTraining/react-router/releases/tag/v6.0.0-alpha.3 | |
| declare module "react-router-dom" { |
| import React from "react"; | |
| import { Link } from "react-router-dom"; | |
| export function createResource(getPromise) { | |
| let cache = {}; | |
| let inflight = {}; | |
| let errors = {}; | |
| function load(key) { | |
| inflight[key] = getPromise(key) |
| import { useState, useRef, useCallback } from 'react'; | |
| export const useSubmit = (fun: Function) => { | |
| const [isPending, setIsPending] = useState<boolean>(false); | |
| const pendingRef = useRef(null); | |
| const submit = useCallback((...args) => { | |
| if (pendingRef.current) { | |
| return; | |
| } |
| const SCROLL_UP = "up"; | |
| const SCROLL_DOWN = "down"; | |
| const useScrollDirection = ({ | |
| initialDirection, | |
| thresholdPixels, | |
| off | |
| } = {}) => { | |
| const [scrollDir, setScrollDir] = useState(initialDirection); |
| /* Basic example of saving cookie using axios in node.js and session's recreation after expiration. | |
| * We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js | |
| * Also, this example supports parallel request and send only one create session request. | |
| * */ | |
| const BASE_URL = "https://google.com"; | |
| // Init instance of axios which works with BASE_URL | |
| const axiosInstance = axios.create({ baseURL: BASE_URL }); |
| import { useLayoutEffect, useCallback, useState } from 'react' | |
| export const useRect = (ref) => { | |
| const [rect, setRect] = useState(getRect(ref ? ref.current : null)) | |
| const handleResize = useCallback(() => { | |
| if (!ref.current) { | |
| return | |
| } |
| import React, { useEffect } from "react" | |
| import useFetch from "./useFetch" | |
| export default function ProcessingPurchase({ | |
| send, | |
| context: { workshopData, ticketsToPurchase, stripeToken } | |
| }) { | |
| let [charge, error] = useFetch("/purchaseWorkshop", { | |
| workshopId: workshopData.id, | |
| ticketsToPurchase, |
| import { applySnapshot, onSnapshot } from 'mobx-state-tree'; | |
| import { transaction } from 'mobx'; | |
| import { AsyncStorage } from 'react-native'; | |
| const getSnapshots = (storesList, storage) => { | |
| const promises = storesList.map(storeName => | |
| storage.getItem(storeName), | |
| ); | |
| return Promise.all(promises).then(snapshots => |