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
window.addEventListener('keydown', function(event) { | |
if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') { | |
let buttons = document.getElementsByClassName("uiButton"); | |
for (let i = 0; i < buttons.length; i++) { | |
let button = buttons[i]; | |
if (button.attributes && button.attributes["data-selenium-test"]) { | |
if (button.attributes["data-selenium-test"].value === "UniversalSaveBar-button-primary") { | |
button.click(); | |
break; | |
} |
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
package se.wendt.statoil.mastercard; | |
import java.util.ArrayList; | |
import java.util.concurrent.CountDownLatch; | |
import redis.clients.jedis.Jedis; | |
import redis.clients.jedis.JedisPubSub; | |
public class JedisTest { |
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
<html> | |
<head> | |
<title>Very nice web page</title> | |
</head> | |
<body background="white"> | |
<h1>Welcome!</h1> | |
<p>This is a paragraph. It rocks!</p> | |
</body> | |
</html> |
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
#!/usr/bin/env python | |
# | |
# Watches the dropfolder, and kicks off the dropfolder-scanner when a file is closed | |
# | |
import pyinotify, os, logging | |
logging.basicConfig(filename='/tmp/dropfolder.log') | |
logger = logging.getLogger('watcher') | |
logger.setLevel(logging.INFO) |
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
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
__version__ = "0.1" | |
__all__ = ["SimpleHTTPRequestHandler"] |
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
// higher order "method" (class) | |
public abstract class UseSafely<T> { | |
public abstract T with(AccountConnection connection); | |
public T runWith(AccountConnection connection) { | |
synchronized (connection) { | |
try { | |
connection.open(); | |
return with(connection); |
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
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
cd | |
sudo apt-get update | |
sudo apt-get upgrade |
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
package fluent; | |
public class ObjectWikiExample { | |
public void someMethod(ObjectWikiDatabaseConnection databaseConnection) { | |
List<Books> books = FromDatabase(dbConn).select(Book.class).with("cover", equal("red")).with("author", like("%Wendt")).fetchAll(); | |
for (Book book : books) { | |
System.out.println(book); | |
} | |
} |
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 Consumer implements UserAPIConsumer { | |
@Override | |
public void doit(UserAPI userAPI) { | |
userAPI.withCurrentOrNextPeriod(new BillingPeriodContext() { | |
@Override | |
public void executedIfPeriodExists(BillingPeriod period) { | |
System.out.println("yes: " + period); | |
} | |
@Override | |
public void executedOtherwise() { |
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
package se.wendt.statoil.mastercard; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; |
NewerOlder