This file contains 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 ReactDOM from 'react-dom'; | |
type ZoomableImageProps = { | |
url: string; | |
style?: React.CSSProperties; // for custom styles | |
className?: string; // to allow custom classes | |
}; | |
/* |
This file contains 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 function runs automatically when the Google Sheet is opened. | |
function onOpen() { | |
// Obtain the user interface of the Google Spreadsheet. | |
var ui = SpreadsheetApp.getUi(); | |
// Create a custom menu titled 'AI Content Generation' in the Spreadsheet's menu bar. | |
ui.createMenu('AI Content Generation') | |
// Add a menu item 'Generate All Values' that when clicked, will run the function 'generateAllValues'. | |
.addItem('Generate All Values', 'generateAllValues') | |
// Add another menu item 'Update Missing Only' that when clicked, will run the function 'updateMissingValues'. |
This file contains 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
// Full code - https://github.com/jackbkennedy/stitches-spinner | |
import { styled, keyframes } from "../stitches.config"; | |
const spinner = keyframes({ | |
to: { | |
transform: "rotate(360deg)", | |
}, | |
}); | |
export const Spinner = styled("div", { |
This file contains 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 {useState, useEffect, useCallback} from 'react'; | |
const EVENT_KEY_DOWN = 'keydown'; | |
const EVENT_KEY_UP = 'keyup'; | |
/* Hook to verify state of Caps Lock */ | |
export function useCaplocks(): boolean { | |
/* State for keeping track of whether caps lock is on */ | |
const [isCaplocksActive, setIsCapLocksActive] = useState<boolean>(false); |