Skip to content

Instantly share code, notes, and snippets.

View ravgeetdhillon's full-sized avatar
🌴
Working Remotely

Ravgeet Dhillon ravgeetdhillon

🌴
Working Remotely
View GitHub Profile
@ravgeetdhillon
ravgeetdhillon / list-master-to-production-prs.js
Last active January 7, 2025 02:43
Script to get all commits that a GitHub user has made after a given date in all repositories owned by the given owner
"use strict";
const PR_NUMBER = "2454"; // pr number for master to production merge
const execSync = require("child_process").execSync;
const getCommitsUnderPrQuery = `gh pr view ${PR_NUMBER} --json "commits"`;
const commitsUnderPrQueryResponse = JSON.parse(
execSync(getCommitsUnderPrQuery, (error, stdout, stderr) => stdout).toString()
@ravgeetdhillon
ravgeetdhillon / list-commits.js
Last active January 7, 2025 02:43
Script to get all commits that a GitHub user has made after a given date in all repositories owned by the given owner
"use strict";
const AFTER_DATE = "2024-12-02";
const MY_GITHUB_ID = "ravgeetdhillon";
const REPOS = ["cloudanswers/designeradvantage-2"];
const beautifyCommitObject = ({
messageBody,
messageHeadline,
prNumber,
@ravgeetdhillon
ravgeetdhillon / font-downloader.py
Last active October 24, 2023 16:39
Download Google font files using this python script.
import requests
import os
def get_urls(content):
'''
Parses the css file and retrieves the font urls.
Parameters:
content (string): The data which needs to be parsed for the font urls.
@ravgeetdhillon
ravgeetdhillon / gmail-filters.md
Last active September 30, 2024 12:16
Gmail Filters

Gmail Filters

Filters for turning Gmail into a productive workspace.

All the unread emails

is:unread
@ravgeetdhillon
ravgeetdhillon / parse-html.js
Created August 9, 2019 07:38
Parsing HTML received from AJAX request.
var ajax = new XMLHttpRequest();
ajax.onreadystatechange = function() {
if (ajax.status == 200 && ajax.readyState == 4) {
var answer = document.createElement( 'html' );
answer.innerHTML = ajax.responseText;
console.log(answer.querySelector('.language-python').innerHTML);
}
}
@pablocattaneo
pablocattaneo / categories.js
Created March 15, 2019 20:49
If you are using the Modules mode of the Vuex store, only the primary module (in store/index.js) will receive this action. You'll need to chain your module actions from there.
export const state = () => ({
categories: []
});
export const mutations = {
setCategories(state) {
state.categories = [
"Pablo",
"Automotor",
"Compras",
@Mohamed3on
Mohamed3on / batchPrettier.md
Last active January 7, 2025 03:23
Run prettier on all JS files in a directory
  1. Install prettier
  2. Make a .prettierignore file, and add directories you'd like prettier to not format, for example: **/node_modules
  3. Run prettier --write "**/*.js" *Don't forget the quotes.
  4. Optional: if you want to format JSON/SCSS files too, replace js with json/scss.