Skip to content

Instantly share code, notes, and snippets.

@tednaleid
tednaleid / BuildConfig.groovy
Last active August 29, 2015 14:05
Grails forked mode debug without suspending for remote debugger to connect first
...
// the jvmArgs flag allows us to override the default suspend=y that grails uses when you do --debug-fork
// the grails docs mention jvmArgs, but lie about it wanting a String, it actually wants a List of Strings
grails.project.fork = [
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true, jvmArgs: ['-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005']],
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false, jvmArgs: ['-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005']],
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false, jvmArgs: ['-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005']],
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, jvmArgs: ['-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005']]
]
...
@tednaleid
tednaleid / test_all_parallel.sh
Last active August 29, 2015 14:12
run grails tests in parallel
#! /usr/bin/env bash
command -v parallel >/dev/null 2>&1 || { echo >&2 "Please install parallel via brew: brew install parallel"; exit 1; }
BASE_DIR=$(cd "$(dirname "$0")"; pwd -P)/..
PARALLEL_WORKERS=2
export GRAILS_OPTS="-Xmx2G -Xms2g -XX:MaxPermSize=500m"
OPEN_TESTLOG_AND_FAIL="( open target/test-reports/html/index.html && exit 1 )"
TEST_APP="( grails test-app --non-interactive || $OPEN_TESTLOG_AND_FAIL )"
@tednaleid
tednaleid / Equity.md
Last active August 29, 2015 14:16 — forked from isaacsanders/Equity.md

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

@tednaleid
tednaleid / simpleParallelDemo.groovy
Created April 24, 2016 23:48
Simple demo demonstrating Ratpack's use of parallel RxJava Observables
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.test.embed.EmbeddedApp
import rx.Observable
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
import ratpack.exec.Blocking
import ratpack.handling.Context
import ratpack.groovy.test.embed.GroovyEmbeddedApp
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('org.slf4j:slf4j-simple:1.7.12')
@Grab('io.ratpack:ratpack-groovy:1.3.3')
@Grab('io.ratpack:ratpack-rx:1.3.3')
import ratpack.exec.Promise
import ratpack.handling.Context
import ratpack.groovy.test.embed.GroovyEmbeddedApp
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('org.slf4j:slf4j-simple:1.7.12')
@Grab('io.ratpack:ratpack-groovy:1.3.3')
@Grab('io.ratpack:ratpack-rx:1.3.3')
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('io.ratpack:ratpack-groovy:1.3.0')
#! /usr/bin/env groovy
import ratpack.exec.Downstream
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.exec.Promise
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service