The cheat sheets in this Gist are for the Oxford Code Retreat on the 6/7/2014.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apply plugin: 'groovy' | |
| apply plugin: 'idea' | |
| project.description = 'something awesome' | |
| project.version = "1.0.0-SNAPSHOT" | |
| project.group = "uk.co.ryanbrooks.example" | |
| repositories { | |
| mavenLocal() | |
| jcenter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def expected | |
| def actual | |
| def propertiesToCompare = expected.class.declaredFields.findAll { !(it.name =~ /^__/ || it.name =~ /^\$/ || it.name == "metaClass") } | |
| // For each property prints [equality] : [property name] -> [expected value] -|- [actual value] | |
| propertiesToCompare.each { property -> | |
| println "${expected[property.name] == actual[property.name]} : ${property} -> ${expected[property.name]} -|exp: ${actual[property.name]} " | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The following | |
| def name = new com.mirth.results.models.NameModel() | |
| name.setPrefix(it[4].toString()) | |
| name.setFirst(it[1].toString()) | |
| name.setMiddle(it[2].toString()) | |
| name.setLast(it[0].toString()) | |
| expectedPatient.setName(name) | |
| // Can be written without .toString and using Groovy's map constructor! | |
| expectedPatient.name = new com.mirth.results.models.NameModel( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Connection request from client, and update every time a test set is run | |
| { | |
| "action": "consumeTestsResults", | |
| "payload": { | |
| "session": 0, | |
| "testsRun": 10, | |
| "testsFailed": 5, | |
| "testsIgnored": 2 | |
| } | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The tests. | |
| it('test', function() { | |
| var a1 = []; | |
| a1.push({x:0, y:2}); | |
| a1.push({x:1, y:2}); | |
| a1.push({x:2, y:2}); | |
| a1.push({x:3, y:3}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| ARGV.each do |arg| | |
| not_repo = [] | |
| unstaged = [] | |
| untracked = [] | |
| puts "Looking in #{arg}" | |
| all_dirs = Dir.entries(arg).select {|entry| File.directory? File.join(arg,entry) and !(entry =='.' || entry == '..') } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0') | |
| import groovy.xml.* | |
| import wslite.soap.* | |
| import wslite.http.auth.* | |
| def client = new SOAPClient('https://dummy:11443/ClinicalDocumentWSService/ClinicalDocumentWS?wsdl') | |
| client.authorization = new HTTPBasicAuthorization("mirth", "password") | |
| // Grab the latest member list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git branch -r --merged | grep -v master | grep -v develop | grep -v release | sed 's/origin\///' | xargs -n 1 git push --delete origin |