Skip to content

Instantly share code, notes, and snippets.

View rajat-np's full-sized avatar

Rajat Soni rajat-np

View GitHub Profile
_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide
@rajat-np
rajat-np / test.py
Created May 21, 2020 16:39 — forked from mrjoes/test.py
How to customize options in QuerySelectField. High level idea: 1. Hook `create_form` to change options when creating model and `edit_form` when editing model 2. Provide different `query_factory` for the field 3. Do filtering/population logic in the _get_parent_list Alternatively: 1. Can hook `scaffold_form` and change `form.parent.kwargs['query_…
from flask import Flask, request, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.admin.contrib import sqlamodel
from flask.ext import admin
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
import zipfile,os
def proxy_chrome(PROXY_HOST,PROXY_PORT,PROXY_USER,PROXY_PASS):
manifest_json = """
{