Skip to content

Instantly share code, notes, and snippets.

View apoorv-arora's full-sized avatar
❤️‍🔥

Apoorv Arora apoorv-arora

❤️‍🔥
View GitHub Profile
@apoorv-arora
apoorv-arora / top_pr_closer.py
Last active August 14, 2023 09:26
Top PR Closer
import requests
from datetime import datetime
import re
def get_top_contributor(username, token, repo_owner, repo_name, start_date, end_date):
headers = {"Authorization": f"Bearer {token}"}
url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/pulls?state=closed&sort=updated&direction=desc"
response = requests.get(url, headers=headers)
pulls = response.json()
@apoorv-arora
apoorv-arora / top_contributor.py
Last active August 14, 2023 08:28
Get Top Contributor for the day
import subprocess
def get_top_contributor(date):
git_command = f'git log --since="{date} 00:00" --until="{date} 23:59" --pretty=format:"%an" --merges'
result = subprocess.run(git_command, shell=True, capture_output=True, text=True)
contributors = result.stdout.splitlines()
if not contributors:
return None, 0
Steps:
1) Go to your notifications page & select Invitations.
2) Right click -> Inspect -> Console.
3) Write the below query for accepting <200 requests.
document.querySelectorAll('.invitation-card__action-btn').forEach(node => node.click())
4) Write the below query for accepting any number of requests.
function clickBatch(selector, batchSize, delay) {
const elements = document.querySelectorAll(selector);
let index = 0;
function clickNextBatch() {
# install bundletool, read more at https://developer.android.com/studio/command-line/bundletool
brew install bundle tool
# extract apks file from aab. If bundle is signed, specify the keystore attributes as well. If the bundle is not signed, you can add universal model, change the output to .zip, & use universal.apk
bundletool build-apks --bundle=bundle.aab --output=output.apks --ks=key.jks --ks-pass=pass:password --ks-key-alias=password --key-pass=pass:password
# install the apks file to your device
bundletool install-apks —apks=output.apks
# extract the path of your package name
@apoorv-arora
apoorv-arora / get-release.py
Created September 14, 2020 06:58
Android Release Bot - Get rollout %
import httplib2
from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
from oauth2client.client import AccessTokenRefreshError
PACKAGE_NAME = (
'your.package.name'
)
TRACK = (
'production'
Those who review the large PRs and keep on clicking "Load Diff", do the following:
1) Open the PR completely, as in all pages, I use CMD+Bottom and complete the load more
2) Right click -> Inspect -> Console and type in the following:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
Let me know if the magic happens for you.