Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Austen djangofan

View GitHub Profile
@djangofan
djangofan / .bash_profile
Last active Feb 21, 2018 — forked from natelandau/.bash_profile
Mac OSX Bash Profile for Developers
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@djangofan
djangofan / jdk8_optional_monad_laws.java
Created Jun 30, 2017 — forked from ms-tg/jdk8_optional_monad_laws.java
Does JDK8's Optional class satisfy the Monad laws? Yes, it does.
View jdk8_optional_monad_laws.java
/**
* ```
* Does JDK8's Optional class satisfy the Monad laws?
* =================================================
* 1. Left identity: true
* 2. Right identity: true
* 3. Associativity: true
*
* Yes, it does.
* ```
@djangofan
djangofan / predicate.java
Last active Mar 31, 2017 — forked from anonymous/test.java
Predicate used in Selenium WebDriver wait
View predicate.java
public void authenticate() {
this.authenticateButton.click();
new WebDriverWait(driver, 30).until(authenticated());
}
private Predicate<WebDriver> authenticated() {
return new Predicate<WebDriver>() {
@Override public boolean apply(WebDriver driver) {
return isAuthenticated();
}
View gist:9925209
import org.testng.annotations.*
import org.testng.TestNG
import org.testng.TestListenerAdapter
@Grab(group='org.testng', module='testng', version='5.7', classifier='jdk15')
class HogeTest {
@Test
void add() {
assert 1 + 1 == 2
}
View selenium2test.java
package com.yahoo.media.mediaqa.selenium2test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.android.AndroidDriver;
import org.openqa.selenium.firefox.*;
import org.openqa.selenium.firefox.internal.ProfilesIni;
@djangofan
djangofan / SeleniumRemoteExample.java
Last active Dec 11, 2015 — forked from neino3/Selenium2Example1Test.java
SeleniumRemote example using Augmenter for screenshot
View SeleniumRemoteExample.java
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Platform;
import org.openqa.selenium.TakesScreenshot;
View create oracle user
create user usr_name identified by [pass***word] profile usr_profile default tablespace usr_ts temporary tablespace temp quota unlimited on usr_ts account unlock
grant create session to usr_name
grant create table to usr_name
grant create view to usr_name
grant create sequence to usr_name
grant create procedure to usr_name
grant create database link to usr_name
@djangofan
djangofan / jboss7-as.sh
Last active Dec 10, 2015 — forked from lionelg3/jboss-as
JBoss 7 Application Server Debian control script
View jboss7-as.sh
#!/bin/sh
# Load JBoss AS init.d configuration.
if [ -z "$JBOSS_CONF" ]; then
JBOSS_CONF="/etc/jboss-as/server-jboss7.conf"
fi
# source the JBoss config file
[ -r "$JBOSS_CONF" ] && . "${JBOSS_CONF}"
View wd_snippet.java
public static void mouseClickByLocator( String cssLocator ) {
String locator = cssLocator;
WebElement el = driver.findElement( By.cssSelector( locator ) );
Actions builder = new Actions(driver);
builder.moveToElement( el ).click( el );
builder.perform();
}