Skip to content

Instantly share code, notes, and snippets.

@uarun
uarun / filetype.vim
Created August 3, 2011 19:32
Gradle syntax highlighting in vim
# ~/.vim/filetype.vim
au BufNewFile,BufRead *.gradle setf groovy
@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 / camel-beans.groovy
Created November 25, 2011 23:49
BeanBuilder definition to scan (spring) container context for Camel Routes
import org.apache.camel.CamelContext
import org.apache.camel.processor.interceptor.DefaultTraceFormatter
import org.apache.camel.processor.interceptor.Tracer
beans {
def config = application.config
xmlns camel: "http://camel.apache.org/schema/spring"
xmlns context: "http://www.springframework.org/schema/context"
@uarun
uarun / _Events.groovy
Created December 18, 2011 04:47
Disable plugin upgrade messages in Grails
//... Disable annoying plugin upgrade messages
def resolveDependenciesWasInteractive = false
eventResolveDependenciesStart = {
resolveDependenciesWasInteractive = isInteractive
isInteractive = false
}
eventResolveDependenciesEnd = {
isInteractive = resolveDependenciesWasInteractive
}
@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 / 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 / zsh.md
Created August 17, 2012 03:11
Zsh Tips & Tricks

Zsh Tips and Tricks

Argument History

!*        # ... All parameters of the last command
!$        # ... Last parameter of the last command
!^        # ... First parameter of the last command
!:1       # ... First parameter of the last command

!-2:2 # ... Second parameter from 2 commands ago