Skip to content

Instantly share code, notes, and snippets.

Graeme Rocher graemerocher

Block or report user

Report or block graemerocher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View oci-micronaut-cla.txt
Micronaut Framework
Individual Contributor License Agreement
By signing below, you accept and agree to the following terms and conditions for Your present and future Contributions submitted to OCI in connection with the Micronaut project. In return, OCI shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with the Apache License v. 2.0. Except for the license granted herein to OCI and recipients of software distributed by OCI, You reserve all right, title, and interest in and to Your Contributions.
1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with OCI. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or manageme
@graemerocher
graemerocher / build.gradle
Created Mar 16, 2017
GORM for MongoDB 6.1 RC1 with Grails 3.2.7
View build.gradle
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.6"
}
}
@graemerocher
graemerocher / TickTockController.groovy
Last active Jul 28, 2016
RxJava for Grails Async Comet Example
View TickTockController.groovy
class TickTockController {
def index() {
Observable.create({ Subscriber subscriber ->
task {
for(i in (0..20)) {
if(i % 2 == 0) {
subscriber.onNext(
Rx.render("Tick")
)
@graemerocher
graemerocher / BookController.groovy
Last active Jul 29, 2016
BookController that uses RxJava and RxGORM for MongoDB
View BookController.groovy
package rxgorm.demo
import grails.artefact.Controller
import grails.rx.web.Rx
import grails.validation.ValidationException
import groovy.transform.CompileStatic
import static org.springframework.http.HttpStatus.*
import static grails.rx.web.Rx.*
import static rx.Observable.*
View oci-grailsframework-cla.txt
Grails Framework
Individual Contributor License Agreement
By signing below, you accept and agree to the following terms and conditions for Your present and future Contributions submitted to OCI in connection with the Grails project. In return, OCI shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with the Apache License v. 2.0. Except for the license granted herein to OCI and recipients of software distributed by OCI, You reserve all right, title, and interest in and to Your Contributions.
1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with OCI. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of
@graemerocher
graemerocher / BookSpec.groovy
Last active Dec 5, 2017
Grails @Integration and Spock example that uses setupSpec
View BookSpec.groovy
package integtest
import grails.test.mixin.integration.Integration
import grails.transaction.*
import spock.lang.*
import geb.spock.*
import grails.util.*
import java.util.concurrent.Callable
View trait-builder-issue.groovy
import groovy.xml.*
trait MyBuilder {
def build2() {
def mkp = new MarkupBuilder()
mkp.foo {
bar()
}
}
@graemerocher
graemerocher / migrate-jira-to-github-issues.groovy
Last active Jun 12, 2018
JIRA to Github Issues Migration Script
View migrate-jira-to-github-issues.groovy
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0')
@Grab(group='joda-time', module='joda-time', version='2.7')
import wslite.rest.*
import org.joda.time.*
import org.joda.time.format.*
import groovy.xml.*
import groovy.json.*
import static java.lang.System.*
import groovy.transform.*
View keybase.md

Keybase proof

I hereby claim:

  • I am graemerocher on github.
  • I am graemerocher (https://keybase.io/graemerocher) on keybase.
  • I have a public key whose fingerprint is E9CD A0A0 60BC E2BC 9BE9 9C4B 1BC6 016E FBF4 6539

To claim this, I am signing this object:

@graemerocher
graemerocher / raw-hibernate-vs-gorm-correlated-subqueries.java
Created Apr 29, 2014
Raw Hibernate vs GORM for Hibernate Correlated Subqueries
View raw-hibernate-vs-gorm-correlated-subqueries.java
// Raw Hibernate
DetachedCriteria employeeCriteria = DetachedCriteria.forClass(Employee.class);
employeeCriteria.createAlias("region", "region").setFetchMode("region", FetchMode.JOIN);
employeeCriteria.add(forName("region.continent").in("APAC","EMEA"));
employeeCriteria.setProjection(distinct(property("employeeId")));
Criteria salesCriteria = sessionFactory.getCurrentSession().createCriteria(Sale.class)
salesCriteria.add(forName("employeeId").in(employeeCriteria));
salesCriteria.add(Restrictions.gt("total",100000));
salesCriteria.setProjection(distinct(property("employeeId")));
You can’t perform that action at this time.