This file contains hidden or 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
| curl http://validator.w3.org/check -i -F output=json -F uploaded_file=@<path-to-html-file> |
This file contains hidden or 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
| /* | |
| * Outputs a color property with an opaque fallback for browsers that do not support RGBA. | |
| */ | |
| @mixin safe-rgba($property, $color, $fallback-color: opacify($color, 1)) { | |
| @if opacity($color) == 1 { | |
| #{$property}: $color; | |
| } @else { | |
| #{$property}: $fallback-color; | |
| .rgba & { | |
| #{$property}: $color; |
This file contains hidden or 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 spock.extensions.state | |
| class StateMachine<E extends Enum> { | |
| private final String name | |
| private E currentState | |
| StateMachine(String name, E initialState) { | |
| this.name = name | |
| currentState = initialState |
This file contains hidden or 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 yaml.encoding | |
| import org.yaml.snakeyaml.Yaml | |
| import spock.lang.* | |
| @Unroll | |
| class YamlEncodingSpec extends Specification { | |
| Yaml yaml = new Yaml() | |
| File file |
This file contains hidden or 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
| UserRole.withCriteria { | |
| createAlias 'user', 'u' | |
| projections { | |
| property 'u.username' | |
| } | |
| eq 'role', role | |
| } |
This file contains hidden or 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
| eventCfUpdateStart = { | |
| metadata.'cf.last.deployed' = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | |
| metadata.persist() | |
| } |
This file contains hidden or 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
| apply plugin: 'groovy' | |
| repositories { | |
| mavenCentral() | |
| // vertxHome must be defined in gradle.properties | |
| flatDir { dirs "${vertxHome}/lib/jars" } | |
| } | |
| dependencies { | |
| groovy 'org.codehaus.groovy:groovy:1.8.6' |
This file contains hidden or 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 co.freeside.spock.vertx | |
| import org.spockframework.runtime.extension.ExtensionAnnotation | |
| import java.lang.annotation.* | |
| /** | |
| * Add this annotation to any specification fields that should be registered as Vert.x event bus handlers during test | |
| * execution. The field will be registered on the event bus before each feature method and unregistered afterwards. If | |
| * the field is `@Shared` it will be registered and unregistered at the start and end of the spec. | |
| * |
This file contains hidden or 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
| void next() { | |
| nextButton.click() | |
| waitForAnimationComplete() | |
| } | |
| private void waitForAnimationComplete() { | |
| waitFor { | |
| js.exec(this.firstElement(), "return \$(arguments[0]).find(':animated').length == 0") | |
| } | |
| } |
This file contains hidden or 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 grails.plugin.spock.IntegrationSpec | |
| import java.sql.Connection | |
| import javax.sql.DataSource | |
| import spock.lang.* | |
| class DatabaseSchemaSpec extends IntegrationSpec { | |
| @Shared def dataSource | |
| @Shared List<String> tableNames |