View gist:8863308
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
import spock.lang.Shared | |
import spock.lang.Specification | |
import spock.lang.Unroll | |
import java.util.regex.Pattern | |
/** | |
* @author musketyr | |
*/ | |
class EmailValidatorSpec extends Specification { |
View gist:9394815
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 com.example.com; | |
import java.io.File; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.security.GeneralSecurityException; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; |
View .bash_profile
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
# Change your JAVA_HOME | |
function setjdk() { | |
if [ $# -ne 0 ]; | |
then export JAVA_HOME=`/usr/libexec/java_home -v $@`; | |
fi; | |
java -version; | |
} | |
# Automatically set the JAVA_HOME | |
setjdk 1.7 |
View test.r.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods-delayed-quotes" | |
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> | |
<SOAP-ENV:Body> | |
<ns1:echo> | |
<message SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="SOAP-ENC:Array"/> | |
</ns1:echo> | |
</SOAP-ENV:Body> |
View runAllActions.js
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
angular.forEach(angular.element('.glyphicon-flash'), function(runAction, index) { | |
setTimeout(function() { | |
angular.element(runAction).click() | |
}, 1000 * 2 * index) | |
setTimeout(function() { | |
angular.element('.modal-dialog .btn.btn-primary').click() | |
}, 1000 * (2 * index) + 1) | |
}) |
View inlineXml.groovy
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
println "Inlining schema COSDCOSD_XMLSchema-v5-0-4r.xsd" | |
File newOne = inlineSchema('COSDCOSD_XMLSchema-v5-0-4r.xsd') | |
println "Inlined schema COSDCOSD_XMLSchema-v5-0-4r.xsd to $newOne" | |
File inlineSchema(String schemaLocation) { | |
saveNodeToFile(inlineIncludes(schemaLocation), schemaLocation.replace('.xsd', '.all.xsd')) | |
} | |
Node inlineIncludes(String xsdFileName, Set<String> included = []) { |
View mc.gdsl
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
contributor (context(filetypes: ['mc'], scope: scriptScope())) { | |
delegatesTo(findClass('org.modelcatalogue.core.util.CatalogueBuilder')) | |
} |
View example-invalid.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<shiporder orderid="889923" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="shiporder.xsd"> | |
<orderperson>John Smith</orderperson> | |
<shipito> | |
<name>Ola Nordmann</name> | |
<address>Langgt 23</address> | |
<city>4000 Stavanger</city> |
View AbstractIntegrationSpec.groovy
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
abstract class AbstractIntegrationSpec extends IntegrationSpec { | |
@Shared | |
def fixtureLoader, fixtures, initCatalogueService, sessionFactory | |
def loadFixtures(){ | |
String scriptLocation = "${System.getProperty('java.io.tmpdir')}mc/testdata.sql" | |
def sql = new Sql(sessionFactory.currentSession.connection()) |
View loginGreachWifi.groovy
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
@Grab(group='commons-codec', module='commons-codec', version='1.10') | |
@Grab(group='org.gebish', module='geb-core', version='0.10.0') | |
@Grab(group='org.seleniumhq.selenium', module='selenium-firefox-driver', version='2.45.0') | |
import geb.* | |
import org.openqa.selenium.firefox.FirefoxDriver | |
new Browser(driver: new FirefoxDriver()).drive("https://invitados.upm.es/dana-na/auth/url_7/welcome.cgi") { | |
$('input', name: 'username').value("aplicaciones.groovy@invitadosupm") | |
$('input', name: 'password').value("groovy2015") |
OlderNewer