Skip to content

Instantly share code, notes, and snippets.

View urban235's full-sized avatar

uavni urban235

  • Tel Aviv
View GitHub Profile
@urban235
urban235 / gist:bb55ab6a8ada8bcc968c67cb03d5dc85
Last active January 25, 2019 16:51
Puppeteer cheat sheet
// Puppeteer cheat sheet
// gonna try and do for puppeteer what capybara got: https://gist.github.com/zhengjia/428105
// to delete an input value
function DeleteInput(page, inputSelector, word){
// input must be focused
page.type(inputSelector, '')
for (let i = 0; i < word.length; ++i) {
@urban235
urban235 / HTTPserverListener
Created March 3, 2018 06:44
Simple server that runs in the background, collecting POST data, passing them to main service via Queue
# from https://stackoverflow.com/questions/49070708/how-to-pass-queue-to-basehttpserver
import multiprocessing
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from io import BytesIO
class QueuingHTTPServer(HTTPServer):
# def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True, queue=False):
def __init__(self, server_address, RequestHandlerClass, queue, bind_and_activate=True):