Skip to content

Instantly share code, notes, and snippets.

View 0xPranavDoshi's full-sized avatar

Pranav Doshi 0xPranavDoshi

View GitHub Profile
@suptejas
suptejas / downloader.py
Created December 25, 2020 15:42
Python Download File With Progress Bar Using Requests
from colorama import Fore
import requests
import sys
# import cursor # Use this if you want to hide or show cursor for a better terminal experience
def download(url: str, download_extension: str, file_path: str, show_progress_bar=True):
'''
Downloads A File from a URL And Saves It To A location
@0xPranavDoshi
0xPranavDoshi / Microsoft.Powershell_profile.ps1
Last active June 9, 2021 05:30
Powershell Profile For Devs
# ⭐ If you find this useful!
# USAGE:
# Go to your powershell profile located here -> %USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# Create the file if it doesn't exist
# Paste the following contents into your powershell profile
Set-PSReadlineOption -Color @{
"Command" = [ConsoleColor]::Green
"Parameter" = [ConsoleColor]::Gray
@0xPranavDoshi
0xPranavDoshi / multithreaded_download.rs
Created July 10, 2021 10:31
Custom MulitThreaded Download in Rust
async fn threaded_download(threads: u64, url: &String, output: &str) {
let mut handles = vec![];
// Create response from url
let res = reqwest::get(url.to_string()).await.unwrap();
// Get the total bytes of the response
let total_length = res.content_length().unwrap();
// Create buffer for bytes