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
includeTargets << grailsScript("_GrailsInit") | |
includeTargets << grailsScript("_GrailsClasspath") | |
includeTargets << grailsScript("_GrailsRun") | |
target(widgetset_init: "init") { | |
vaadinConfig = new ConfigSlurper(grails.util.Environment.current.name).parse(new File("${basedir}/grails-app/conf/VaadinConfig.groovy").text) | |
ant.property(name: "widgetset", value: vaadinConfig.vaadin.widgetset) | |
ant.property(name: "workers", value: "4") | |
ant.property(name: "widgetset-path", value: "") | |
ant.property(name: "client-side-destination", value: "web-app/VAADIN/widgetsets") |
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 com.vaadin.sass.internal.ScssStylesheet | |
eventCreateWarStart = { name, stagingDir -> | |
new File("${stagingDir}/VAADIN/themes/").eachDir { | |
def scssName = "${it}/styles.scss" | |
if (new File(scssName).exists()) { | |
ScssStylesheet scss = ScssStylesheet.get(scssName) | |
scss.compile() | |
def outFile = new File("$it/styles.css") | |
outFile.write(scss.toString()) |
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 -s -XDELETE localhost:9200/so_delete_parent >/dev/null | |
curl -s -XPUT localhost:9200/so_delete_parent/ -d '{ "settings": { "index": { "number_of_shards" : 2 } } }' >/dev/null | |
curl -s -XPUT localhosT:9200/so_delete_parent/childs/_mapping -d '{ "_parent": { "type": "parents" } }' >/dev/null | |
curl -s -XPUT localhost:9200/so_delete_parent/childs/A\?parent=1 -d '{ "doc": "parent 1" }' | |
curl -s -XPUT localhost:9200/so_delete_parent/childs/A\?parent=2 -d '{ "doc": "parent 2" }' | |
curl -s localhost:9200/so_delete_parent/childs/A\?parent=1 | json_pp | |
curl -s localhost:9200/so_delete_parent/childs/A\?parent=2 | json_pp | |
curl -s localhost:9200/so_delete_parent/childs/A\?parent=666 | json_pp | |
curl -s localhost:9200/so_delete_parent/childs/A | json_pp # fails with ES 1.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 com.vaadin.ui.Component | |
import com.vaadin.ui.CustomField | |
import com.vaadin.ui.TextArea | |
class MultiLineField extends CustomField<List<String>> { | |
private TextArea textArea = new TextArea() | |
MultiLineField() { | |
super() |
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
/* groovy */ | |
import groovy.transform.CompileStatic | |
@CompileStatic | |
@Singleton | |
class RegularSingleton { | |
void foo() { println 'foo' } | |
} |
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
class Widget { | |
void doStuff() { println 'doing stuff' } | |
String sayStuff(String name) { return "Hello $name" } | |
void fail() { throw new RuntimeException("Boom") } | |
} | |
class WidgetService { | |
// our service now has all the methods, Widget has | |
@Delegate Widget widget = new Widget() | |
// adding other stuff is fine too |
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
/* fluent run and test caller to get rid of if-else-cascades */ | |
class RunAndCheck { | |
final Optional input | |
Optional output | |
RunAndCheck(Optional input=null) { this.input = input } | |
static RunAndCheck start(Closure action) { new RunAndCheck().run(action) } |
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 groovy.lang.BenchmarkInterceptor | |
class Bench { | |
static final String CSV = 'csv.csv' | |
void runOriginal() { | |
BigDecimal tot = 0G | |
new File(CSV).splitEachLine(";") { row -> | |
try { |
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
@Grapes([ | |
@Grab('org.vaadin.spring:spring-boot-vaadin:0.0.3'), | |
@Grab('com.vaadin:vaadin-server:7.4.0.beta1'), | |
@Grab('com.vaadin:vaadin-client-compiled:7.4.0.beta1'), | |
@Grab('com.vaadin:vaadin-themes:7.4.0.beta1'), | |
]) | |
import org.vaadin.spring.VaadinUI | |
import com.vaadin.server.VaadinRequest | |
import com.vaadin.ui.* |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("stackoverflow.com") { | |
body { | |
color: black; | |
background-color: #999; | |
font-family: "Liberation Sans"; | |
} | |
.excerpt { color: black } | |
} |
OlderNewer