A Pen by Keldon Rush on CodePen.
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
function blockScroll( e ){ | |
e.preventDefault(); | |
e.stopPropagation(); | |
e.cancelBubble = true; | |
} | |
document.addEventListener('wheel', blockScroll, true ); | |
document.addEventListener('mousewheel', blockScroll, true ); | |
document.addEventListener('DOMMouseScroll', blockScroll, true ); |
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
<h2>MP3 Player</h2> | |
<label for="dirpath">URL</label> | |
<input type="text" id="dirpath" placeholder="URL to directory with MP3 files"> | |
<button class="go">go</button> | |
<br/> | |
<b>keepAwake</b> | |
<input type="checkbox" id="keepawake"> | |
<br/> | |
<table> | |
<tr> |
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
// pick an easy element from the dom | |
const bar = document.querySelector( '.nav-primary' ); | |
// listen for the click event and nextSlide | |
bar.addEventListener( 'click', nextSlide ); | |
/* | |
* Sample URL : | |
* https://definition.org/meghan-markle-facts/40/ | |
*/ |
This inserts a "Standup" button into the Jira interface. When clicked, it will display a list of all the people who have filters created for them - in a random order.
- in the Chrome browser
- when filters created for each team member
- with the Chrome extension below installed (and configured with the code below)
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
# region : timers | |
# example usage : | |
# npm run clean && startTimer && npm run build && endTimer | |
function startTimer() { | |
START_TIME=$(date +%s.%N) | |
} | |
function endTimer() { |
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
canvas { | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
width: 100vw; | |
height: 100vh; | |
z-index: 1000; |
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
a.btn-standup:hover { | |
color: black !important; | |
} | |
.popup-standup { | |
font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; | |
position: fixed; | |
z-index: 5000; | |
padding: 0px 10px; | |
border: 1px solid black; |
A utility to extract and pretty-print specific CSS classes which contain rules for properties which match the propsToGlean
array members.
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 { RefObject, useEffect, useState, useRef } from 'react'; | |
const useElementRect = <T extends HTMLElement>(): [RefObject<T>, DOMRect] => { | |
const [rect, setRect] = useState<DOMRect>(new DOMRect()); | |
const ref = useRef<T>(null); | |
useEffect(() => { | |
const updateRect = () => setRect(ref?.current?.getBoundingClientRect() || new DOMRect()); |