Skip to content

Instantly share code, notes, and snippets.

View mudssrali's full-sized avatar
🕸️
Crafting software solutions for better, at scale

Mudassar mudssrali

🕸️
Crafting software solutions for better, at scale
View GitHub Profile
@mudssrali
mudssrali / pdf-to-csv.py
Created November 23, 2022 04:13
Python script to convert Excel tables from PDF file to CSV
import pandas as pd
from tabula import read_pdf
# Specify file name
FILE_NAME = "sample.pdf"
# Total Pages
TOTAL_PAGES = 2
# Read the first page.
final_frame = read_pdf(FILE_NAME, pages="1")[0]
@mudssrali
mudssrali / object-diff.ts
Last active January 21, 2023 09:43
Deep difference between two object, using lodash
//@ts-nocheck
import { isEqual, isObject, transform } from 'lodash'
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
@mudssrali
mudssrali / upload.sh
Created February 2, 2023 12:26
Bash script to download a dir, zip it and upload to Google Cloud Storage using gsutil
#!/usr/bin/env bash
# make sure this bash script has executable permission, if doesn't have, run following command
# > $ chmod +x *.sh
gsutil - m cp - r "gs://[BUCKET_PATH]/$1". \
zip - r /root/ $1.zip $1 \
rm - rf $1 \
gsutil cp /root/ $1.zip gs://[BUCKET_PATH]/ \
rm -rf /root/$1.zip