Skip to content

Instantly share code, notes, and snippets.

View mohtada-h's full-sized avatar

Mohtada Hassanpour mohtada-h

View GitHub Profile
@mohtada-h
mohtada-h / change-failure-rate.sh
Last active January 5, 2025 17:58
To calculate the change failure rate, you need to determine the percentage of changes that resulted in a failure, typically indicated by revert commits. Here's how you can calculate it using Git
# Count all commits in the last month
total_commits=$(git log --since='1 month ago' --oneline | wc -l)
# Count revert commits in the last month
revert_commits=$(git log --since='1 month ago' --grep='^Revert' -i --oneline | wc -l)
# Calculate the percentage of revert commits
percentage=$(echo "scale=2; ($revert_commits / $total_commits) * 100" | bc)
echo "Change Failure Rate: $percentage%"

Keybase proof

I hereby claim:

  • I am mohtada-h on github.
  • I am mohtada (https://keybase.io/mohtada) on keybase.
  • I have a public key ASCkfbz9mL02mm7-hJrSicboeDJsKs2Wf3X8D2kX8hMXogo

To claim this, I am signing this object:

(async function () {
const token = JSON.parse(localStorage.getItem('user')).token;
const headers = new Headers();
const url = 'https://web-api.snapp.ir/api/v1/ride/history';
const query = '?page=';
let total = 0;
let page = 1;
headers.append('Authorization', token);
headers.append('Content-Type', 'application/json');