Skip to content

Instantly share code, notes, and snippets.

View ernesto-alvarado's full-sized avatar

ernesto alvarado ernesto-alvarado

View GitHub Profile
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 = """
{
@simonw
simonw / installing-presto-cli.md
Created May 29, 2018 18:16
Installing the Presto command-line tool

Installing the Presto command-line tool

I had to install Java to get presto working

brew cask install java

From https://prestodb.io/docs/current/installation/cli.html I did:

wget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.202/presto-cli-0.202-executable.jar

mv presto-cli-0.202-executable.jar presto

@VingeB0
VingeB0 / react flux - simple example counter
Created February 7, 2018 16:22
react flux - simple example counter
import React, {Component} from 'react';
import logo from './logo.svg';
import './App.css';
import {EventEmitter} from 'events';
import {Dispatcher} from 'flux';
const AppDispatcher = new Dispatcher();
const CHANGE_EVENT = 'CHANGE';
@gasparrobi
gasparrobi / headlessChrome.md
Last active March 25, 2024 09:23
headless chrome from terminal in osX

1. set an alias for chrome:

alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

2. To remote control your chrome headless:

chrome --headless --disable-gpu --remote-debugging-port=9222

@yasinkuyu
yasinkuyu / desiredcapabilities.py
Created September 8, 2017 14:07
Python Selenium Luminati Proxy Desired Capabilities (Exclude localhost)
#@yasinkuyu 08/09/2017
# install luminati (https://luminati.io) proxy manager & run
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.proxy import *
PROXY = '127.0.0.1:24000'
@nikhita
nikhita / update-golang.md
Last active May 10, 2024 19:31
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@h4
h4 / env.py
Last active March 13, 2024 07:22
Setup alembic to work properly with PostgreSQL schemas
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from models import Base
config = context.config
fileConfig(config.config_file_name)
@ruanbekker
ruanbekker / boto3_emr_create_cluster_with_wordcount_step.py
Created March 21, 2017 19:16
Create EMR Cluster with a Wordcount Job as a Step in Boto3
import boto3
client = boto3.client(
'emr',
region_name='eu-west-1'
)
cmd = "hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar wordcount file:///etc/services /output"
emrcluster = client.run_job_flow(
@cgoldberg
cgoldberg / geckodriver-install.sh
Last active August 18, 2023 10:20
download and install latest geckodriver for linux or mac (selenium webdriver)
#!/bin/bash
# download and install latest geckodriver for linux or mac.
# required for selenium to drive a firefox browser.
install_dir="/usr/local/bin"
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
if [[ $(uname) == "Darwin" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos"))')
elif [[ $(uname) == "Linux" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
import React, { PropTypes, Component } from 'react'
class ContextExample extends Component {
static childContextTypes = {
config: PropTypes.object,
}
getChildContext() {