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-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 / 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 / gist:f32aa09261c4157a1408
Created April 17, 2015 16:31
stylish: gamestar.de no-javascript
@-moz-document domain("gamestar.de") {
noscript > * { display: none !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 / 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;
}
}
@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 / reflection-in-macros.clj
Created March 6, 2017 20:19
Experiment about using reflection in macros for #clojure
(require '[clojure.reflect :refer [type-reflect]])
(require '[clojure.walk :refer [postwalk]])
(require '[clojure.set :refer [subset?]])
(defn public-static? [{:keys [flags]}]
(subset? #{:public :static} flags))
(def public-static-member?
(memoize
(fn public-static-member? [cls sym]
@christoph-frick
christoph-frick / update_ad_block
Created March 24, 2017 20:43
Generate a block list for unbound
curl https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt | grep '^0.0.0.0' | awk '{ print "local-zone: \"" $2 "\" refuse" }' > ad-blocking-data.conf
@christoph-frick
christoph-frick / ConverterField.groovy
Last active April 25, 2017 12:23
Vaadin CustomField for a Value-type, that wrapps a field for a Presentation-type and uses a Converter to transform between the two
package net.ofnir.vaadin.form
import com.vaadin.data.BeanValidationBinder
import com.vaadin.data.Binder
import com.vaadin.data.Converter
import com.vaadin.data.HasValue
import com.vaadin.shared.Registration
import com.vaadin.ui.AbstractField
import com.vaadin.ui.Component
import com.vaadin.ui.CustomField
@christoph-frick
christoph-frick / vaadin8.groovy
Created May 31, 2017 14:46
Minimal failing example, V8 ComboBox not deleting text of previous selected item
// run with `spring run --watch vaadin.groovy`
@Grapes([
@Grab('com.vaadin:vaadin-spring-boot-starter:2.0.1'),
@Grab('com.vaadin:vaadin-archetype-application:8.0.5'),
])
import com.vaadin.ui.*
import java.time.*
@com.vaadin.spring.annotation.SpringUI
@com.vaadin.annotations.Theme("valo")