Skip to content

Instantly share code, notes, and snippets.

View joshcawthorne's full-sized avatar

Josh Cawthorne joshcawthorne

View GitHub Profile
@joshcawthorne
joshcawthorne / rename_files.sh
Last active October 5, 2023 13:18
Update files and folders from camelCase to PascalCase. This script is designed to recursively update the capitalization of both files and directories in the current directory. Intended to update a project from using camelCase to PascalCase.
#!/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:
# -
@joshcawthorne
joshcawthorne / parseStoryblokLink.js
Last active May 4, 2021 10:01
Util to parse Storyblok Links
@joshcawthorne
joshcawthorne / useWindowSize.js
Last active October 5, 2023 13:21
SSR-Compatible (NextJS, Gatsby etc) React hook for getting Window Size.
import { useState, useEffect } from "react";
function useWindowSize() {
const [windowSize, setWindowSize] = useState<{ width: number | undefined; height: number | undefined }>({
width: undefined,
height: undefined,
});
useEffect(() => {
function handleResize() {