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 { useCallback, useEffect, useRef, useState } from "react"; | |
| interface UseUndoHook<T> { | |
| value: T; | |
| onChange: (newValue: T) => void; | |
| undo: () => void; | |
| redo: () => void; | |
| clear: () => void; | |
| canUndo: boolean; | |
| canRedo: boolean; |
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 openai | |
| import requests | |
| import re | |
| import json | |
| openai.api_key = "X" | |
| # Define WooCommerce credentials. | |
| site_url = "https://yoursite.com/" |
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
| // Dynamically import an NPM module from dev.jspm.io to try it out. | |
| // Run this in your browser console. | |
| (async function() { | |
| const axios = (await import('https://dev.jspm.io/axios')).default; | |
| const response = await axios.get('https://pokeapi.co/api/v2/pokemon/'); | |
| console.log(response.data); | |
| })(); |
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 queryDatoGraphQL = require('./query-dato-graphql.js'); | |
| module.exports = function (config) { | |
| // Custom data file formats (https://www.11ty.dev/docs/data-custom/) | |
| config.addDataExtension( | |
| 'graphql', | |
| async (query) => await queryDatoGraphQL({ query }) | |
| ); | |
| // Base Config |
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
| var list = []; | |
| document.querySelectorAll("body *") | |
| .forEach(function(elem){ | |
| if(elem.getBoundingClientRect().width > document.body.getBoundingClientRect().width){ | |
| list.push(elem.outerHTML.split('>')[0] + '>'); | |
| } | |
| }); | |
| confirm( "these elements are wider than the viewport:\n\n " + list.join("\n") ) |
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
| /* eslint-disable jsx-a11y/rule-name */ | |
| const path = require("path") | |
| require("dotenv").config({ | |
| path: `../.env.${process.env.NODE_ENV}`, | |
| }) | |
| module.exports = { | |
| siteMetadata: { |
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 { createHttpLink } = require('apollo-link-http'); | |
| const fetch = require('node-fetch'); | |
| const store = require('store'); | |
| const sourceNodes = require('gatsby/dist/utils/source-nodes'); | |
| require('dotenv').config(); | |
| const craftGqlUrl = process.env.CRAFT_GQL_URL; | |
| const craftGqlToken = process.env.CRAFT_GQL_TOKEN; | |
| module.exports = { |
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
| // Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
| // http://creativecommons.org/publicdomain/zero/1.0/ | |
| // HTML files: try the network first, then the cache. | |
| // Other files: try the cache first, then the network. | |
| // Both: cache a fresh version if possible. | |
| // (beware: the cache will grow and grow; there's no cleanup) | |
| const cacheName = 'files'; |
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 from 'react' | |
| import styled from 'emotion/react' | |
| import { omit } from 'emotion/lib/utils' | |
| import { space, width, fontSize, color, responsiveStyle } from 'styled-system' | |
| import { baseCss } from './ui' | |
| const defaultExcludedProps = [ | |
| 'm', | |
| 'mt', |
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
| # <type>: (If applied, this commit will...) <subject> (Max 50 char) | |
| # |<---- Using a Maximum Of 50 Characters ---->| | |
| # Explain why this change is being made | |
| # |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
| # Provide links or keys to any relevant tickets, articles or other resources | |
| # Example: Github issue #23 |
NewerOlder