Skip to content

Instantly share code, notes, and snippets.

View JadedEvan's full-sized avatar

Evan Reeves JadedEvan

View GitHub Profile
@JadedEvan
JadedEvan / git-merge-single-file.sh
Last active October 21, 2016 15:04
How to revert a file to a known working state and apply upstream changes in a patch from a different branch.
# Check out the original file should receive the changes. This should be the version on your working branch
git checkout {MY-WORKING-BRANCH-SHA} -- path/to/my/file.txt
# Generate a diff of the file, ignoring space changes against a known branch. You should be on your working branch for this
git checkout my-working-branch
git diff HEAD..master --ignore-space-change -- path/to/my/file.txt > patch.diff
# Apply the patch. Note that you MUST use the same --ignore-space-change flag to apply properly
git apply --ignore-space-change patch.diff
@JadedEvan
JadedEvan / jira-story-point-count.js
Created October 13, 2020 09:31
Javascript snippet to add up the total of story points for a Jira issue search
var total=0;$('#issuetable .issuerow .customfield_10025').each(function(index){if(this.innerText != ''){total += parseInt(this.innerText)}});console.log(total);