Skip to content

Instantly share code, notes, and snippets.

Aaron Evans fijiaaron

Block or report user

Report or block fijiaaron

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SauceAnalyticsAPIWithHttpClient.java
package com.saucelabs.api.examples.analytics;
import io.mikael.urlbuilder.UrlBuilder;
import org.junit.Test;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
@fijiaaron
fijiaaron / UpdateTest.java
Created Aug 12, 2019
Update failing test with custom data about the failure
View UpdateTest.java
import com.saucelabs.saucerest.SauceREST;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
View python_data_science_lesson_2.py
# Python Data Science lesson 2
# strings
greeting = "Hello, World!"
print(greeting)
# a string is a sequence of characters
print(greeting[0]) #=> 'H'
# index starts with 0, so index 5 is the 6th character
View first_babies.py
import nsfg
df = nsfg.ReadFemPreg()
def first_babies(df):
for index, row in df.iterrows():
if row.prgoutcome == 1: # only report on live births
print(index, row.caseid, row.prgoutcome, row.pregordr, row.birthord, row.wksgest)
first_babies(df)
@fijiaaron
fijiaaron / GetJobInfoResponse.java
Last active Mar 22, 2019
Use GSON to parse Sauce Labs getJobInfo JSON response into a POJO object
View GetJobInfoResponse.java
package com.saucelabs.api.responses;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class GetJobInfoResponse
{
public String assigned_tunnel_id;
public String automation_backend;
@fijiaaron
fijiaaron / GetErroredTests.java
Created Mar 15, 2019
Using the Sauce Labs Analytics REST API
View GetErroredTests.java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import com.mashape.unirest.request.HttpRequest;
import io.restassured.path.json.JsonPath;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@fijiaaron
fijiaaron / BookDownload_StepDefs.java
Last active Mar 13, 2019
Demonstrate how to check that a file can be downloaded
View BookDownload_StepDefs.java
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import org.openqa.selenium.By;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
@fijiaaron
fijiaaron / flv2mp4.sh
Created Feb 27, 2019
Convert FLV to MP4 using FFMPEG
View flv2mp4.sh
#!/usr/bin/env bash
flv_input="$1"
mp4_output=`echo "$flv_input" | sed s/flv$/mp4/`
echo converting $flv_input to $mp4_output
ffmpeg -i "$flv_input" "$mp4_output"
View RubyAccessors
Demonstrate how to use getters and setters in Ruby
View foo.1.rb
class Foo
# initialize instance variables
def initialize(bar="bar", baz="baz")
@bar = bar
@baz = baz
end
end
You can’t perform that action at this time.