Skip to content

Instantly share code, notes, and snippets.

View mbensch's full-sized avatar

Marcel Bensch mbensch

View GitHub Profile
// @refactor
import { useState, useRef, useEffect } from 'react';
import { addEventListener } from 'consolidated-events';
import KeyCode from 'lib/constants/KeyCode';
const useKeyboardNavigation = (maxFocus = null, vimMode = false) => {
const ref = useRef(null);
const [focusedIndex, setFocusedIndex] = useState(0);
#!/bin/sh
# git prepare-commit-msg hook for automatically prepending an issue key
# from the start of the current branch name to commit messages.
# check if commit is merge commit or a commit ammend
if [ $2 = "merge" ] || [ $2 = "commit" ]; then
exit
fi
ISSUE_KEY=`git branch | grep -o "\* \(.*/\)*[A-Z]\{2,\}-[0-9]\+" | grep -o "[A-Z]\{2,\}-[0-9]\+"`