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
#!/bin/bash | |
# -------------------------------------------------------------------------- | |
# Script Author: @joshcawthorne | |
# Warning: BACKUP ALL YOUR FILES BEFORE RUNNING THIS - THIS IS A DESTRUCTIVE | |
# OPERATION, I AM NOT RESPONSIBLE FOR ANY LOST FILES. | |
# OS Compatibility: MacOS, Linux, and WSL on Windows 10/11. | |
# -------------------------------------------------------------------------- | |
# Description: | |
# - |
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 nullLink = null; | |
function isValidFullSlug(link) { | |
return typeof link == "string" && link[0] !== "/"; | |
} | |
function parseStoryblokLink(link) { | |
if (!parseStoryblokLink.isValidUrl(link)) { | |
return nullLink; | |
} |
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 { useState, useEffect } from "react"; | |
function useWindowSize() { | |
const [windowSize, setWindowSize] = useState<{ width: number | undefined; height: number | undefined }>({ | |
width: undefined, | |
height: undefined, | |
}); | |
useEffect(() => { | |
function handleResize() { |