Skip to content

Instantly share code, notes, and snippets.

View rushkeldon's full-sized avatar

Keldon Rush rushkeldon

View GitHub Profile
@rushkeldon
rushkeldon / stop_scroll.js
Created January 25, 2018 19:39
Stops all scrolling events on a page from being handled by javascript. Paste in your console for Google Slides when using a Magic Mouse (for example)
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 );
@rushkeldon
rushkeldon / index.html
Created October 20, 2020 13:49
mp3_player
<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>
@rushkeldon
rushkeldon / nextSlide.js
Created July 8, 2023 14:26
next slide please - now
// 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/
*/
@rushkeldon
rushkeldon / JIRA_STANDUP_GENERATOR.MD
Last active April 17, 2024 05:22
jira random standup order generator

WHAT

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.

Caveats - Only Works :

  • in the Chrome browser
  • when filters created for each team member
  • with the Chrome extension below installed (and configured with the code below)

HOW

@rushkeldon
rushkeldon / bash_functions.sh
Last active April 15, 2024 06:30
useful bash functions for your .bash_profile or similar
# region : timers
# example usage :
# npm run clean && startTimer && npm run build && endTimer
function startTimer() {
START_TIME=$(date +%s.%N)
}
function endTimer() {
@rushkeldon
rushkeldon / gamify.css
Last active April 17, 2024 04:54
gamify Jira with sound effects and fireworks when moving tickets by dragging
canvas {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100vw;
height: 100vh;
z-index: 1000;
@rushkeldon
rushkeldon / jira_addon.css
Last active April 18, 2024 21:40
Jira Addon : adds a standup button and gamifies Jira a bit with FX
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;
@rushkeldon
rushkeldon / useElementRect.ts
Created October 23, 2024 08:07
useElementRect - a react hook that keeps the current rectangle inhabited by an element up-to-date
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());