Skip to content

Instantly share code, notes, and snippets.

View christoph-frick's full-sized avatar

Christoph Frick christoph-frick

View GitHub Profile
@christoph-frick
christoph-frick / vaadin.groovy
Created February 7, 2017 21:19
Minimal Springboot Vaadin
// run with `spring run --watch vaadin.groovy`
@Grab('com.vaadin:vaadin-spring-boot-starter:1.2.0')
import com.vaadin.ui.*
@com.vaadin.spring.annotation.SpringUI
@com.vaadin.annotations.Theme("valo")
class MyUI extends UI {
protected void init(com.vaadin.server.VaadinRequest request) {
setContent(new Label("Hello World"))
}
@christoph-frick
christoph-frick / stylish.css
Created September 14, 2015 11:10
stylish fix zeit.de
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("zeit.de") {
* {
font-family: "Times New Roman" !important;
letter-spacing: inherit !important;
}
}
@Grapes([
@Grab('org.vaadin.spring:spring-boot-vaadin:0.0.5.RELEASE'),
@Grab('com.vaadin:vaadin-server:7.4.6'),
@Grab('com.vaadin:vaadin-client-compiled:7.4.6'),
@Grab('com.vaadin:vaadin-themes:7.4.6'),
])
import org.vaadin.spring.annotation.VaadinUI
import com.vaadin.server.VaadinRequest
import com.vaadin.ui.*
@christoph-frick
christoph-frick / gist:f32aa09261c4157a1408
Created April 17, 2015 16:31
stylish: gamestar.de no-javascript
@-moz-document domain("gamestar.de") {
noscript > * { display: none !important }
}
@christoph-frick
christoph-frick / gist:75c4c95c8e2a9371fffe
Created March 31, 2015 22:12
get rid of the stackoverflow tamagochi with stylish
#egg-sidebar-module { display: none }
@christoph-frick
christoph-frick / vaadin-elements.groovy
Created January 27, 2015 10:41
foolin' around with vaadin elements
@GrabResolver(name='vaadinAddons', root='http://maven.vaadin.com/vaadin-addons', m2Compatible='true')
@Grapes([
@Grab('org.vaadin.spring:spring-boot-vaadin:0.0.3'),
@Grab('com.vaadin:vaadin-server:7.4.0.beta2'),
@Grab('com.vaadin:vaadin-client-compiled:7.4.0.beta2'),
@Grab('com.vaadin:vaadin-themes:7.4.0.beta2'),
@Grab('org.vaadin:elements:0.1.1'),
])
import org.vaadin.spring.VaadinUI
import com.vaadin.server.VaadinRequest
@christoph-frick
christoph-frick / stylish-so.css
Last active August 29, 2015 14:13
collection of fixes for stylish to make SO readable again
@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 }
}
@christoph-frick
christoph-frick / spring-run-vaadin.groovy
Created January 17, 2015 19:32
minimalistic springboot vaadin example; run with `spring run vaadin`
@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.*
import groovy.lang.BenchmarkInterceptor
class Bench {
static final String CSV = 'csv.csv'
void runOriginal() {
BigDecimal tot = 0G
new File(CSV).splitEachLine(";") { row ->
try {
@christoph-frick
christoph-frick / runandcheck.groovy
Created October 18, 2014 16:42
Fluent groovy API to run and check several steps (code that usually is found in controllers with logs of errors checking) as seen in http://stackoverflow.com/questions/24034324/groovy-code-simplification-and-if-elimination
/* 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) }