This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A map of bit masks that correlate to a person's status. | |
* @type {Object} | |
*/ | |
var personStatus=(function(){ | |
var i=0.5; | |
return { | |
CODING:(i*=2), | |
EATING:(i*=2), | |
READING:(i*=2), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name="global"; | |
var a = { | |
name:"a", | |
prop:Func, | |
b:{ | |
name:"b", | |
prop:Func | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var byLocator = By.cssSelector('.some.selector'); | |
var timeout = 5;//seconds | |
var element = (new WebDriverWait(driver, timeout)) | |
.until(ExpectedConditions.visibilityOfElementLocated(byLocator)); | |
console.log(element.getText()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -x | |
set -e | |
# Make sure /dev/shm has correct permissions. | |
ls -l /dev/shm | |
sudo chmod 1777 /dev/shm | |
ls -l /dev/shm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var equal = require('assert').equal; | |
var instance = this; | |
var lengthFacade = 0; | |
this.push = function(value){ | |
this[getLength()] = value; | |
}; | |
Object.defineProperty(this, 'length', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host="`hostname`" | |
if [ -z "`grep -o "$host" /etc/hosts`" ];then | |
sed -i "s|\(127.0.0.1.*\)$|\1 $host|" /etc/hosts | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SignInCtrl( | |
$rootScope, | |
$scope, | |
credentials, | |
events, | |
handleUser, | |
User | |
){ | |
$scope.isLoading = false; | |
$scope.generalError = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SearchWidget<T extends Page> | |
extends HasPage<T>, HasDriver { | |
String SEARCH_WIDGET_BUTTON_SELECTOR = "#searchWidgetButton"; | |
default T clickSearchWidgetButton() { | |
getDriver() | |
.findElement(By.id(SEARCH_WIDGET_BUTTON_SELECTOR)) | |
.click(); | |
return getPage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomePage extends Page<HomePage> | |
implements SearchWidget { | |
// package private contructor | |
HomePage () {} | |
// Home Page specific methods | |
public HomePage doSomethingOnTheHomePage() { | |
// do something | |
return this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Page<T extends Page> | |
implements HasDriver, HasPage<T> { | |
protected WebDriver driver; | |
private String endpoint; | |
protected String getPagePath(); | |
@Override | |
public WebDriver getDriver() { |
OlderNewer