Skip to content

Instantly share code, notes, and snippets.

View Spring3's full-sized avatar
🇺🇦

Daniel Vasylenko Spring3

🇺🇦
View GitHub Profile
@Spring3
Spring3 / test.json
Last active March 10, 2021 23:18
test.json
{"MRData":{"xmlns":"http:\/\/ergast.com\/mrd\/1.4","series":"f1","url":"http://ergast.com/api/f1/2018/circuits.json","limit":"30","offset":"0","total":"21","CircuitTable":{"season":"2018","Circuits":[{"circuitId":"albert_park","url":"http:\/\/en.wikipedia.org\/wiki\/Melbourne_Grand_Prix_Circuit","circuitName":"Albert Park Grand Prix Circuit","Location":{"lat":"-37.8497","long":"144.968","locality":"Melbourne","country":"Australia"}},{"circuitId":"americas","url":"http:\/\/en.wikipedia.org\/wiki\/Circuit_of_the_Americas","circuitName":"Circuit of the Americas","Location":{"lat":"30.1328","long":"-97.6411","locality":"Austin","country":"USA"}},{"circuitId":"bahrain","url":"http:\/\/en.wikipedia.org\/wiki\/Bahrain_International_Circuit","circuitName":"Bahrain International Circuit","Location":{"lat":"26.0325","long":"50.5106","locality":"Sakhir","country":"Bahrain"}},{"circuitId":"BAK","url":"http:\/\/en.wikipedia.org\/wiki\/Baku_City_Circuit","circuitName":"Baku City Circuit","Location":{"lat":"40.3725","long":
@Spring3
Spring3 / webpack.config.js
Created May 20, 2017 00:21
Webpack 2 config [node,react,babel,webpack]
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './web/dynamic/react.js',
output: {
path: path.join(__dirname, 'web', 'static', 'js'),
filename: 'bundle.min.js'
},
target: 'node',
@Spring3
Spring3 / gist:42629b7ab7ab2f557d89
Last active October 28, 2021 04:16
Solve google recaptcha using 2captcha API and Selenium WebDriver
//client = HttpClient
//captchaUserId = user id from http://2captcha.com
private String solveCaptcha(WebDriver driver) throws Exception{
WebElement captchaChallenge = driver.findElement(By.id("recaptcha_challenge_image"));
if (captchaChallenge != null){
String imageURL = captchaChallenge.getAttribute("src");
InputStream in = new BufferedInputStream(new URL(imageURL).openStream());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i; (i = in.read()) != -1;){