Skip to content

Instantly share code, notes, and snippets.

View firestar300's full-sized avatar

Milan Ricoul firestar300

View GitHub Profile
@firestar300
firestar300 / fixtures.json
Last active February 28, 2024 17:11
Schema for fixtures in Cypress Omnes Education project
{
"properties": {
"name": {
"description": "The slug name of your site.",
"type": "string",
"minLength": 1
},
"production": {
"description": "The production URL of your site.",
"type": "object",
@firestar300
firestar300 / useKeyDown.js
Created December 13, 2024 13:34
Useful React Hooks
import { useEffect, useState } from 'react'
/**
* Custom hook that listens for keydown events and triggers a callback when specified keys are pressed.
*
* @param {Function} callback - The function to call when one of the specified keys is pressed.
* @param {Array<string>} keys - An array of key names to listen for.
*/
export default function useKeyDown(callback, keys) {
const onKeyDown = (event) => {