Skip to content

Instantly share code, notes, and snippets.

@uarun
uarun / build.gradle
Created September 3, 2014 01:49
Resolving version conflicts with Gradle
allprojects { project ->
configurations.all {
resolutionStrategy {
//... Fail eagerly on version conflict (includes transitive dependencies)
//... For e.g. multiple different versions of the same dependency (group and name are equal)
failOnVersionConflict()
//... Force certain versions of dependencies (including transitive)
force libraries.scala_library
@uarun
uarun / DataSource.groovy
Created August 3, 2011 19:35
Pooled DataSource configuration in Grails
dataSource {
pooled = true
driverClassName = "oracle.jdbc.driver.OracleDriver"
username = "user"
password = "password"
properties {
maxActive = 10
maxIdle = 10
minIdle = 0
@uarun
uarun / camel-beans.groovy
Created November 21, 2011 18:56
BeanBuilder definition to scan packages for Camel Routes
import org.apache.camel.CamelContext
import org.apache.camel.processor.interceptor.DefaultTraceFormatter
import org.apache.camel.processor.interceptor.Tracer
beans {
xmlns camel: "http://camel.apache.org/schema/spring"
camelTracer(Tracer) {
traceOutExchanges = true
logLevel = 'INFO'
@uarun
uarun / BeanBuilderTests.groovy
Created November 25, 2011 22:48
Creating collections in BeanBuilder
import static org.junit.Assert.*;
import org.springframework.beans.factory.config.ListFactoryBean;
import grails.spring.BeanBuilder;
import grails.test.GrailsUnitTestCase;
class BeanBuilderTests extends GrailsUnitTestCase {
@uarun
uarun / about.md
Created April 12, 2012 21:39 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@uarun
uarun / minscalaactors.scala
Created April 13, 2012 04:18 — forked from viktorklang/minscalaactors.scala
Minimalist Scala Actors
©2012 Viktor Klang
object Actor {
import java.util.concurrent.{ConcurrentLinkedQueue, Executor}
import java.util.concurrent.atomic.{AtomicBoolean}
type Behavior = Any => Effect
sealed trait Effect { def getOrElse(old: Behavior): Behavior }
case object Stay extends Effect { def getOrElse(old: Behavior): Behavior = old }
case class Become(like: Behavior) extends Effect { def getOrElse(old: Behavior): Behavior = like }
@uarun
uarun / logback.xml
Last active October 6, 2015 15:11
Slick 2.0 - Enabling SQL Statement Logging
<logger name="scala.slick.jdbc.JdbcBackend.statement" level="DEBUG" />
@uarun
uarun / shell.txt
Created July 16, 2012 23:22
Fix SSL Certificate errors accessing github
$ export GIT_SSL_NO_VERIFY=true # ... Skips CA Certificate verification
$ git clone https://github.com/uarun/dotfiles.git
@uarun
uarun / BuildConfig.groovy
Created September 27, 2012 20:52
Accessing authenticated Nexus (from Grails)
import org.apache.ivy.util.url.CredentialsStore
CredentialsStore.INSTANCE.addCredentials(
nexusRealm,
nexusHost,
nexusUserName,
nexusPassword
)
/* Example *
@uarun
uarun / scalac-options.md
Last active December 9, 2015 20:39
Useful scalac options (for scala 2.10)

Useful Scalac Options

-encoding "UTF-8"

-target:jvm-1.6

Uses the ASM Compiler backend to generate bytecode (Scala 2.10)

-deprecation