Skip to content

Instantly share code, notes, and snippets.

View msguner's full-sized avatar
🎯
Focusing

Muhammet Safa GÜNER msguner

🎯
Focusing
View GitHub Profile
@lorey
lorey / selenium_xhr_requests_via_performance_logging.py
Last active April 14, 2024 09:11
Access Chrome's network tab (e.g. XHR requests) with Selenium
#
# This small example shows you how to access JS-based requests via Selenium
# Like this, one can access raw data for scraping,
# for example on many JS-intensive/React-based websites
#
from time import sleep
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
@rengler33
rengler33 / scrape_with_logs.py
Last active May 2, 2024 07:30
How to Capture Network Traffic When Scraping with Selenium & Python
# see rkengler.com for related blog post
# https://www.rkengler.com/how-to-capture-network-traffic-when-scraping-with-selenium-and-python/
import json
import pprint
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
capabilities = DesiredCapabilities.CHROME
"""Extract nested values from a JSON tree."""
def json_extract(obj, key):
"""Recursively fetch values from nested JSON."""
arr = []
def extract(obj, arr, key):
"""Recursively search for values of key in JSON tree."""
if isinstance(obj, dict):
@patrickjh
patrickjh / CustomizedAndroidRunner.java
Last active April 2, 2023 21:08
Junit Retries annotation for Android
package whatever;
import android.app.Instrumentation;
import android.os.Bundle;
import android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
import android.support.test.internal.util.AndroidRunnerParams;
import org.junit.rules.TestRule;
import org.junit.runners.model.InitializationError;
@tomsihap
tomsihap / gist:e703b9b063ecc101f5a4fc0b01a514c9
Created December 23, 2018 14:46
Install NVM in Ubuntu 18.04 with ZSH
# Find the latest version on https://github.com/creationix/nvm#install-script
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Add in your ~/.zshrc the following:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ source ~/.zshrc
@luisbandalap
luisbandalap / ASimpleSOAPClient.java
Last active February 8, 2021 16:13 — forked from kdelfour/ASimpleSOAPClient.java
A simple SOAP Client class to send request body to a SOAP Server. Useful when you want to test a SOAP server and you don't want to generate all SOAP client class from the WSDL.
package com.kdstudio.snippets.soap.client;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.parsers.DocumentBuilderFactory;
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@idreamsi
idreamsi / pythonscript.py
Last active September 9, 2021 20:58
Python script for Telegram
# -*- coding: utf-8 -*-
#!/usr/bin/python
import subprocess
import os
import picamera
import time
import shlex
from datetime import datetime
from datetime import timedelta
import datetime as dt
import collections
class DictProxy(collections.Mapping):
"""
A proxy for a dictionary that allows attribute access to underlying keys.
You may pass a custom ``wrapper`` to override the logic for wrapping
various custom types.
"""
@fatihacet
fatihacet / sublime.conf.json
Last active May 6, 2019 07:33
sublime.conf
{
"close_windows_when_empty": false,
"color_scheme": "Packages/One Dark Color Scheme/One Dark.tmTheme",
"detect_indentation": false,
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
"env":
{
"PATH": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/share/npm/bin/"
},