symfony new --full my_project # Create empty project symfony (web app)
symfony serve # Start the dev server
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 from "react" | |
const Modal = ({ children }: { children: React.ReactNode }) => { | |
return React.Children.map(children, (child) => { | |
if (!React.isValidElement(child)) { | |
return null; | |
} | |
React.cloneElement(child); | |
}); | |
}; |
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
const isArrayEmpty = (arr: unknown[]): boolean => Array.isArray(arr) && !arr.length; | |
const capitalize = (s: string): string => s.charAt(0).toUpperCase() + s.slice(1); | |
const isObjectEmpty = (obj: unknown): boolean => obj && Object.keys(obj).length === 0; | |
const randomInteger = (min: number, max: number): number => Math.floor(Math.random() * (max - min + 1)) + min; | |
const clamp = (input: number, min: number, max: number): number => input < min ? min : input > max ? max : input |