Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Vladimir Orany musketyr

I may be slow to respond.
View GitHub Profile
musketyr / gaelyk-sample.groovy
Created Mar 25, 2011
How should be Gaelyk plugins defined in Gradle build
View gaelyk-sample.groovy
// since the missing task arguments, the plugins will be defined in gaelyk block
apply plugin: 'gaelyk'
gaelyk {
// during each build will be checked this plugins against installed and any missing
// will be installed automatically
apply git: ''
apply zip: 'path/to/zipped/'
// if I delete or comment some installed plugin, it will be uninstalled automatically
musketyr / build.gradle
Created Apr 1, 2011
How could be simply passed arguments to the Gradle build
View build.gradle
task args = [:]
tasks.addRule("Pattern: <property>=<value>: Passes arguments to the scripts") { String taskName ->
def match = taskName =~ /(.*?)=(.*?$)/
if(match){[match[0][1]] = match[0][2]
task(taskName) << {
println "Used to pass value ${match[0][2]} to${match[0][1]}"
View gaelyk.dsld
import java.util.concurrent.Future;
// Things to discuss
// # are there any ways how to promote dsls to templates like gtpl?
// # are there any ways to check operators like left shift?
// # is there any way to handle generics like Key<Entity>?
// # how to handle closure parameters?
class EnvDescriptor {
String name
View categoryExplorer.groovy
import java.lang.reflect.Method;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import groovyx.gaelyk.GaelykCategory;
// scaffolds DSLD for category class to the system console
// setup
musketyr / gist:980544
Created May 19, 2011
shortcutFor pointcut
View gist:980544
def shortcutFor = { type ->
currentType(type) &
shortcutFor('').accept {
provider = 'Gaelyk'
// contributions
musketyr / gist:980549
Created May 19, 2011
groovlets contributions
View gist:980549
(sourceFolderOfCurrentType('war/WEB-INF/groovy') & enclosingScript()).accept {
provider = 'Gaelyk Groovlet'
property name: 'datastore',
type: ''
// many more here
method name: 'forward',
type: 'void',
params: [path: 'java.lang.String'],
musketyr / gist:980550
Created May 19, 2011
image manipulations language
View gist:980550
(enclosingCallName("transform") &
inClosure() &
provider = 'Gaelyk'
method name: 'feeling',
type: '',
params: [lucky: boolean],
doc: 'Applies the "I\'m feeling lucky" transformation.'
View GSQL.groovy
class GSQL {
static SelectBuilder select(Object... what){
SelectBuilder builder = []
if(All.ALL in what){
builder.all = true
} else {
builder.columns = what
View QueryBuilder.groovy
class QueryBuilder {
String spreadsheet
String worksheet
String query
String order
String contains
boolean all
View OrderBuilder.groovy
class OrderBuilder{
QueryBuilder queryBuilder
QueryBuilder column(int position){
queryBuilder.order = '' + position