This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from glob import glob | |
import time | |
import logging | |
import sys | |
import shutil | |
import requests | |
from sha256sum import sha256sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prompts by https://gist.github.com/iamtalhaasghar | |
# Written by Chatgpt | |
# 25-Feb-2024 | |
curl -X POST \ | |
-H "Authorization: Bearer <your_access_token>" \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"user_id": "@<target_user>:<server_domain>", | |
"content": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imaplib | |
import re | |
import time | |
from dotenv import load_dotenv | |
import os | |
import email | |
load_dotenv() | |
imap_ssl_host = 'imap.gmail.com' | |
imap_ssl_port = 993 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -v https://go.dev/dl/go1.18.5.linux-amd64.tar.gz | |
rm -rvf /usr/local/go && tar -C /usr/local -xvzf go1.18.5.linux-amd64.tar.gz | |
cd /opt | |
git clone https://github.com/jesseduffield/lazygit.git | |
cd lazygit | |
/usr/local/go/bin/go install | |
echo "alias lg='$HOME/go/bin/lazygit'" >> ~/.bashrc | |
$HOME/go/bin/lazygit --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
data = pd.read_csv('emails.csv') | |
data = data.set_index('Roll') | |
data.to_html('emails.html') | |
#data = data.drop('Name',axis=1) | |
#data.to_excel('emails.xlsx',sheet_name='Sheet1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sign all previous commits | |
git rebase --root --exec "git commit --amend --author='Talha Asghar <talhaasghar.contact@simplelogin.fr>' --no-edit --allow-empty" | |
git rebase --committer-date-is-author-date --root | |
git push -f | |
# Sign all commits to-date but dont touch commits before this point in history .i.e. commit hash "SHA256HASHEXAMPLE0000" | |
# Replace "SHA256HASHEXAMPLE0000" with your commit hash | |
git rebase SHA256HASHEXAMPLE0000 --exec "git commit --amend --author='Talha Asghar <talhaasghar.contact@simplelogin.fr>' --no-edit --allow-empty" | |
git rebase --committer-date-is-author-date SHA256HASHEXAMPLE0000 | |
git push -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let jspdf = document.createElement("script"); | |
jspdf.onload = function () { | |
let pdf = new jsPDF(); | |
let elements = document.getElementsByTagName("img"); | |
for (let i in elements) { | |
let img = elements[i]; | |
console.log("add img ", img); | |
if (!/^blob:/.test(img.src)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple program to calculate actual withdraw amount of payoneer | |
payoneerCut = 2 | |
rate = int(input('Enter currency rate of USD -> YOUR_NATIVE_CURRENCY : ')) | |
amount = int(input('Enter amount to withdraw (in YOUR_NATIVE_CURRENCY): ')) | |
rate = (rate - ((payoneerCut / 100) * (rate))) | |
print('New Rate of USD -> YOUR_NATIVE_CURRENCY : %.2f' % (rate)) | |
print("You`ll recieve: %.2f (in YOUR_NATIVE_CURRENCY)" % (rate * amount)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A python module which creates .zip & .rar archives of subfolders of a given path | |
def subFolders(folder_path): | |
'Returns list of subfolders of given path' | |
import os | |
foldersList = list() | |
print('Looking for subfolder of : %s' % (folder_path)) | |
for i in os.listdir(folder_path): | |
if(os.path.isdir(i)): | |
print('%s' % (i), end=', ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple script to prettify pdf file names | |
def listAllPdfFiles(dirPath): | |
'Return list of all pdf files of provided path' | |
import os | |
pdfFiles = list() | |
print('Looking for pdf files...') | |
for f in os.listdir(): | |
if(os.path.isfile(f) and f.endswith('.pdf')): | |
print('%s' % f, end=", ") |
NewerOlder