Skip to content

Instantly share code, notes, and snippets.

View jvdl's full-sized avatar

John van der Loo jvdl

View GitHub Profile
@jvdl
jvdl / issues-in-commits.sh
Last active October 24, 2024 00:56
A shell script that will list all the Jira issues noted in commit messages for a given range, or since a given ref/hash
#!/bin/bash
# The issue key(s) to match in commit messages
# If a single string is required, you _can_ specify it as a string or keep as an array
ISSUE_KEYS=("FOO" "BAR")
# Create a pattern that matches the issue keys, assuming the format KEY-123 (i.e. string, hyphen, number)
_pattern=$(
IFS=\|
echo "(${ISSUE_KEYS[*]})-[0-9]+"
### Keybase proof
I hereby claim:
* I am jvdl on github.
* I am jvanderloo (https://keybase.io/jvanderloo) on keybase.
* I have a public key ASA1jxkvvoWByhbH9E4GVhv1uhfGKmQWxTu3TfIyEC7pEQo
To claim this, I am signing this object:
@jvdl
jvdl / .gitconfig
Created April 30, 2023 05:14
Webstorm as git difftool / mergetool on macOS
[diff]
tool = webstorm
[merge]
tool = webstorm
[difftool "webstorm"]
cmd = /Applications/WebStorm.app/Contents/MacOS/webstorm diff $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\")
trustExitCode = true
[mergetool "webstorm"]
cmd = /Applications/WebStorm.app/Contents/MacOS/webstorm merge $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\")
trustExitCode = true
@jvdl
jvdl / task-with-kbd-shortcut.md
Last active September 20, 2022 22:12
VS Code

Task

To set up custom tasks, in .vscode/tasks.json add a task like this:

{
  "label": "Test Affected",
  "type": "shell",
  "command": "nx affected --target=test"
}
@jvdl
jvdl / git-helpers.sh
Last active September 15, 2022 03:48
Git Helpers
# Generally useful git stuff.
# Revert the initial commit in a repository.
# You may want to add something else to the commit or rewrite the message
# Or commit as a different user.
#
# You can't `git reset HEAD~1` at this point because there is no previous commit to revert to
# Fortunately git can delete the HEAD ref which effectively means that git no longer
# knows which changes are contained in it, effectively marking everything changed
# since the last commit as a new unstaged changed.
@jvdl
jvdl / suppress-experimental-warnings.js
Last active September 6, 2022 01:52
Suppress experimental feature warnings in Node.JS
/**
* This will prevent specific experimental warnings from being logged
* to the console. For example if in Node 18 you are using the now native
* fetch, you will see a warning about it.
* To suppress this warning:
*
* import suppressWarnings from './suppress-experimental-warnings';
* suppressWarnings.fetch();
*/
import process from 'process';
@jvdl
jvdl / require-node-version.js
Last active September 6, 2022 01:52
Require a specific Major Node version in code
import process from 'process';
const NODE_VERSION = process.version;
export default {
major: function (version) {
if (parseInt(NODE_VERSION.substring(1, 3)) < version) {
console.error(`Node version must be ${version} or higher.`);
process.exit(1);
}