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
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # | |
| # Set the bash prompt according to: | |
| # * the branch/status of the current git repository | |
| # * the branch of the current subversion repository | |
| # * the return value of the previous command | |
| # | |
| # USAGE: |
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
| // Gradle tests | |
| // single file: | |
| gradle -Dtest.single=TestClass :module-name:test --info | |
| // single method: | |
| gradle :module-name:test --tests *TestClass.methodToTest --info --stacktrace | |
| // single test, Grails 3: | |
| grails test-app -integration com.mypackage.myapp.MySpec.my_test_which_may_need_underscores_for_this_to_work |
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
| import grails.async.Promise | |
| import grails.async.Promises | |
| import scala.concurrent.Future | |
| import akka.dispatch.Futures | |
| import akka.dispatch.OnComplete | |
| import java.util.concurrent.Callable | |
| def actorSystem = ctx.getBean('actorSystem') | |
| def dispatcher = actorSystem.dispatcher() |
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
| /** | |
| * Utility methods to make logging a little cleaner. Instead of having to put | |
| * log.isDebugEnabled() (and etc) checks everywhere we want to log to debug, this will do the | |
| * check in a single place. And because the strings to log are being passed as a closure, they | |
| * will be lazily evaluated. | |
| * | |
| * Note: this trait assumes there is a "log" variable on the class, presumably injected into | |
| * Grails artefacts or through use of the groovy.util.logging.Slf4j annotation. | |
| * | |
| * Note: updated all methods to static so these can be called from static methods. Required |
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
| import groovy.io.FileType | |
| def files = [] | |
| def extensions = ['.groovy', '.md', '.yml', '.gradle', '.json', '.html', '.puml', '.properties'] | |
| def foldersToExclude = ['/.gradle/', '/.idea/', '/build/'] | |
| def dir = new File("/path/to/checked/out/git/repo") | |
| println "dir = $dir" | |
| dir.eachFileRecurse (FileType.FILES) { file -> |
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
| // TODO: think about whether this makes more sense as a trait... | |
| class ClassUtils { | |
| // exclude all fields that start with these prefixes from the list returned by getFields() method | |
| private static final List<String> EXCLUDED_FIELD_PREFIXES = ['grails_', '$', '__'] | |
| // Added exclusion of "grails_" and "$" fields - causes problems with Validateable cmd objs. | |
| // Added exclusion of "__" due to Cobertura adding "__cobertura_counters" field. | |
| /** |
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
| groovy.grape.Grape.grab(group:'org.springframework', module:'spring-web', version:'4.2.5.RELEASE') | |
| import org.springframework.web.util.UriComponentsBuilder |
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
| import json | |
| import sublime | |
| import sublime_plugin | |
| import threading | |
| import urllib | |
| import urllib2 | |
| # Sublime plugin to use Groovy REPL functionality as offered by a Spring Boot | |
| # app with the necessary server-side support. | |
| # |
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
| // corrected from initial approach, using % 15. My first attempt was wrong. This is what I get for not writing tests. Although tests on println...hmm... | |
| def fizzBuzz = { | |
| for (int x=1; x <= 100; x++) { | |
| if (x % (15) == 0) println "FizzBuzz" | |
| else if (x % 3 == 0) println "Fizz" | |
| else if (x % 5 == 0) println "Buzz" | |
| else println x | |
| } | |
| } |
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
| #!/bin/bash | |
| #minikube start --vm-driver=xhyve | |
| minikube start --memory=8000 --vm-driver=xhyve --container-runtime=docker --v=3 --v=10 --alsologtostderr --insecure-registry="docker...io:5000" | |
| kubectl cluster-info |