Skip to content

Instantly share code, notes, and snippets.

@ishults
ishults / afterWith.groovy
Last active December 16, 2015 20:09
Assignment using .with()
Dog dog = new Dog()
//...
dog.with {
name = 'Rex'
age = 2
color = Color.BLACK
}
@ishults
ishults / multipleAssignmentUsingWith.groovy
Last active December 16, 2015 20:09
Multiple assignment using .with()
Dog dog = new Dog()
//...
dog.with {
(name, age, color) = ['Rex', 2, Color.BLACK]
}
assert 'Rex' == dog.name
assert 2 == dog.age
assert Color.BLACK == dog.color
@ishults
ishults / nonWorking.groovy
Last active December 16, 2015 20:09
Non-working example of multiple assignment
Dog dog = new Dog()
//...
(dog.name, dog.age, dog.color) = ['Rex', 2, Color.BLACK] // Does not work
@ishults
ishults / npm-install
Last active December 16, 2015 20:08
npm karma install
npm install -g karma
npm install karma-jasmine@2_0 --save-dev
npm install karma-phantomjs-launcher --save-dev
npm install karma-remote-reporter --save-dev
npm install -g karma-cli
@ishults
ishults / npm-list
Last active December 16, 2015 20:08
npm list
npm list --depth=0
npm list -g --depth=0
@ishults
ishults / karma1.conf.js
Last active December 16, 2015 20:08
autoWatch karma config
reporters: ['progress'],
remoteReporter: {},
autoWatch: true,
singleRun: false
@ishults
ishults / karma2.conf.js
Last active December 16, 2015 20:08
Grails plugin karma config
reporters: ['remote'],
remoteReporter: {
host: 'localhost',
port: '9889'
},
autoWatch: false,
singleRun: true
@ishults
ishults / karma start
Last active December 16, 2015 20:08
karma start
karma start karma.conf.js
@ishults
ishults / grails test-app
Last active December 16, 2015 20:08
grails test-app
grails test-app
@ishults
ishults / grails test-app javascript
Last active December 16, 2015 20:08
grails test-app javascript
grails test-app unit:javascript