Skip to content

Instantly share code, notes, and snippets.

View r000tmnt's full-sized avatar
💭
Looking for opportunity

r000tmnt

💭
Looking for opportunity
View GitHub Profile
@wooddar
wooddar / multiprocess_selenium.py
Last active June 20, 2025 07:10
Easy Python script to run selenium web workers/browsers in parallel
"""
This is an adaptable example script for using selenium across multiple webbrowsers simultaneously. This makes use of
two queues - one to store idle webworkers and another to store data to pass to any idle webworkers in a selenium function
"""
from multiprocessing import Queue, cpu_count
from threading import Thread
from selenium import webdriver
from time import sleep
from numpy.random import randint
@AshikNesin
AshikNesin / base64-form-data.js
Last active February 22, 2025 17:30
Base64 image to multipart/form-data
const base64 = 'data:image/png;base64,....' // Place your base64 url here.
fetch(base64)
.then(res => res.blob())
.then(blob => {
const fd = new FormData();
const file = new File([blob], "filename.jpeg");
fd.append('image', file)
// Let's upload the file
// Don't set contentType manually → https://github.com/github/fetch/issues/505#issuecomment-293064470