View build.gradle
This file contains 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
buildscript { | |
repositories { | |
mavenLocal() | |
maven { url "https://repo.grails.org/grails/core" } | |
} | |
dependencies { | |
classpath "org.grails:grails-gradle-plugin:$grailsVersion" | |
//classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" | |
//classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2" | |
} |
View application.groovy
This file contains 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
//add this to your spring security config. | |
grails.plugin.springsecurity.rejectIfNoRule = false | |
grails.plugin.springsecurity.fii.rejectPublicInvocations = false | |
grails.plugin.springsecurity.ipRestrictions = [ | |
'/shutdown':['127.0.0.1'] | |
] |
View MainController.java
This file contains 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 app; | |
import org.springframework.beans.MutablePropertyValues; | |
import org.springframework.beans.factory.support.BeanDefinitionRegistry; | |
import org.springframework.beans.factory.support.GenericBeanDefinition; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |
import org.springframework.http.server.ServletServerHttpResponse; | |
import org.springframework.web.servlet.ModelAndView; |
View script-gorm-hibernate4.groovy
This file contains 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
@Grab("org.grails:grails-datastore-gorm-hibernate4:3.1.4.RELEASE") | |
@Grab("com.h2database:h2:1.3.173") | |
@Grab("org.grails:grails-spring:2.5.0") | |
@Grab('org.slf4j:slf4j-simple:1.7.12') | |
import grails.orm.bootstrap.* | |
import grails.persistence.* | |
import org.springframework.jdbc.datasource.DriverManagerDataSource | |
import org.h2.Driver | |
def init = new HibernateDatastoreSpringInitializer(Person) |
View boot-gorm-hibernate4.groovy
This file contains 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
@Grab("org.grails:gorm-hibernate4-spring-boot:1.1.0.RELEASE") | |
@Grab("com.h2database:h2:1.3.173") | |
import grails.persistence.* | |
import org.springframework.http.* | |
import static org.springframework.web.bind.annotation.RequestMethod.* | |
// curl -XPOST http://localhost:8080/person/add -F 'firstName=Tony' | |
// curl -XGET 'http://localhost:8080/person/greet?firstName=Tony' | |
@RestController | |
class GreetingController { |
View build.gradle
This file contains 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: 'java' | |
apply plugin: 'spring-boot' | |
apply plugin: 'idea' | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath('org.springframework.boot:spring-boot-gradle-plugin:1+') |
View gist:4a9585033727d2b53b1f
This file contains 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
#ifdef DEBUG | |
# define LOG(...) NSLog(__VA_ARGS__) | |
# define LOG_CURRENT_METHOD NSLog(@"%@/%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)) | |
# define LogPoint(p) LOG(@"%s:%@",#p,NSStringFromCGPoint(p)) | |
# define LogRect(r) LOG(@"%s:%@",#r,NSStringFromCGRect(r)) | |
# define LogSize(s) LOG(@"%s:%@",#s,NSStringFromCGSize(s)) | |
#else | |
# define LOG(...) ; | |
# define LOG_CURRENT_METHOD ; |
View script-gorm-mongodb.groovy
This file contains 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
@Grab("org.grails:grails-datastore-gorm-mongodb:4.0.0.RELEASE") | |
@Grab("org.springframework:spring-expression:4.1.6.RELEASE") | |
@Grab('org.slf4j:slf4j-simple:1.7.12') | |
import grails.persistence.* | |
import grails.mongodb.geo.* | |
import grails.mongodb.bootstrap.* | |
import org.bson.types.ObjectId | |
import com.mongodb.BasicDBObject | |
def initializer = new MongoDbDataStoreSpringInitializer(City) |
View boot-gorm-mongodb.groovy
This file contains 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
@Grab('org.grails:gorm-mongodb-spring-boot:1.1.0.RELEASE') | |
import grails.persistence.* | |
import grails.mongodb.geo.* | |
import org.bson.types.ObjectId | |
import com.mongodb.BasicDBObject | |
import com.mongodb.Mongo | |
import org.springframework.http.* | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.data.mongodb.core.mapping.MongoMappingContext | |
import static org.springframework.web.bind.annotation.RequestMethod.* |
View grails-domain-dbcollection.gdsl
This file contains 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.intellij.patterns.PsiJavaPatterns | |
import com.intellij.patterns.PlatformPatterns | |
def ctx = context( | |
ctype: PsiJavaPatterns.psiClass().withName(PlatformPatterns.string().matches(/.*/)) | |
) | |
contributor(ctx) { | |
def path = "" | |
try { |
NewerOlder