Skip to content

Instantly share code, notes, and snippets.

View smaldini's full-sized avatar

Stephane Maldini smaldini

View GitHub Profile
@smaldini
smaldini / gist:1226907
Created September 19, 2011 16:36
Lovely
//code :
class SampleController{
def action2(){
println new SampleDomain(name :"test").save()
render ""
}
}
| Error 2011-09-19 18:34:59,638 ["http-bio-8080"-exec-5] ERROR hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
Line | Method
@smaldini
smaldini / gist:1232540
Created September 21, 2011 16:26
mongodb
compile ":mongodb:1.0.0.M7", {
excludes 'grails-datastore-mongo','grails-datastore-gorm-mongo','grails-datastore-simple',
'grails-datastore-gorm-plugin-support', 'grails-datastore-web', 'grails-datastore-gorm',
'grails-datastore-core', 'grails-datastore-gorm-test'
}
class DocumentModel implements DocumentModelNode {
static final SCORE = 40
String id // UUID , for replications / optimization
String name
String description = ''
Date dateCreated
Date lastUpdated
compile ":test:1.0"
class SomeController{
def testInlineListener = {
//register with 'logout' topic on 'app' default namespace
def listener = on("logout") {User user ->
println "test $user"
}
render "$listener registered"
<servlet>
<description>MeteorServlet</description>
<servlet-name>MeteorServlet</servlet-name>
<servlet-class>org.grails.plugin.platform.events.push.GrailsMeteorServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.cpr.broadcaster.shareableThreadPool</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.broadcaster.maxProcessingThreads</param-name>
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsTest")
includeTargets << grailsScript("_GrailsWar")
target(main: "Clean, Test, and War") {
clean()
allTests() // results in (1)
//packageApp() not needed
warCreator.configureWarName()
war()
/*
* Copyright 2003-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2013 SpringSource
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Deferred head = Streams.defer().
env(env).
batchSize(333).
dispatcher(Environment.RING_BUFFER).
get()
Stream tail = head.compose().collect()
tail.consume(consumer { List<Integer> ints ->
println ints.size()
println Thread.currentThread()