Skip to content

Instantly share code, notes, and snippets.

View cliffdarling's full-sized avatar

Cliff Darling cliffdarling

View GitHub Profile
@cliffdarling
cliffdarling / config.ru
Created August 17, 2012 17:04
Rack config for static sites
#use this as config.ru to deploy static sites on Heroku
use(Rack::Static, :urls => ["/js", "/css", "/images", "/etc"])
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
@cliffdarling
cliffdarling / SvnExportExample.java
Created April 11, 2012 17:46
SVNKit export from Subversion example
import java.io.File;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNRevision;
@cliffdarling
cliffdarling / SecondWindowIsOpened.java
Created March 21, 2012 14:50
Selenium Webdriver expected coindition that can be used to wait for a pop-up or other window to open
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
/**
* Implementation of ExpectedCondition that waits until a second window is opened
* Useful when you need to wait for a pop-up window
* @author cliff.darling
*
*/
@cliffdarling
cliffdarling / ExpectedTextIsPresent.java
Created March 21, 2012 14:42
Selenium Web Driver condition used to wait until some specific or non-empty text Is present in an element
import org.openqa.selenium.By;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
/**
* Implementation of ExpectedCondition that waits until some specific text is present
* in the specified element
* If the expected text is null, this will wait until there is any non-empty text in the element.