Skip to content

Instantly share code, notes, and snippets.

View rylanharper's full-sized avatar

Rylan Harper rylanharper

View GitHub Profile
import React, {useState, useEffect, useRef} from 'react'
import classNames from 'classnames'
import {useIntersection} from 'use-intersection'
const Video = ({
video,
poster,
posterWidth = 1920,
posterFitMode = 'preserve',
@lukeocodes
lukeocodes / Breadcrumbs.vue
Last active March 24, 2025 11:14
A breadcrumbs component for Nuxt3
<script lang="ts" setup>
const route = useRoute();
const router = useRouter();
const getBreadcrumbs = () => {
const fullPath = route.path;
const requestPath = fullPath.startsWith("/")
? fullPath.substring(1)
: fullPath;
const crumbs = requestPath.split("/");
@erikthalen
erikthalen / getRefs.ts
Last active March 11, 2024 19:24
Never write a querySelector again
/**
*
* @param {HTMLElement} [target=document.body] - Element to querySelect in
* @param {boolean} [namespaced] - Only get children with data-ref-parent-ref
* @param {string} [exclude] - Selector or element who's children wont be selected
* @param {boolean | function} [watch] - Watches DOM and updates refs on mutation
* @param {boolean} [asArray] - Saves all refs in arrays, also single elements
* @returns {Object} { myRef: div, another: [button, span] }
*/
export default ({
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active May 23, 2026 10:57
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 5, 2026 13:01
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example