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 * as React from 'react' | |
type UseStopwatch = { | |
seconds: number, | |
startStopwatch: () => void, | |
stopStopwatch: () => void, | |
resetStopwatch: () => void | |
} | |
const useStopwatch = (): UseStopwatch => { |
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
<snippet> | |
<content><![CDATA[ | |
//////////////////////////////////////////////////////////////////////////////// | |
// ${1:Title} | |
//////////////////////////////////////////////////////////////////////////////// | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>////</tabTrigger> |
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 generateRandomPaceholder = (name: string): string => { | |
const placeholders = [ | |
`For example, ${name} loves a good belly scratch and long walks at twilight on the beach.`, | |
`For example, ${name} is a legend and a great dog`, | |
`For example, ${name} is the best dog I could have ever wished for`, | |
`For example, ${name} makes me so happy my heart hurts` | |
] | |
const placeholderText = placeholders[Math.floor(Math.random() * placeholders.length)] |
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
<picture class=""> | |
<source srcset="<%= asset_path('.../.../WEBP_ASSET.webp') %>" type="image/webp" /> | |
<img src="<%= asset_path('../../FALLBACK_ASSET.jpg') %>" type="image/jpg" /> | |
</picture> |