This file contains 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
@Grapes( | |
@Grab(group='commons-lang', module='commons-lang', version='2.6') | |
) | |
/*@Grapes( | |
@Grab(group='org.apache.commons', module='commons-lang3', version='3.3') | |
)*/ | |
import org.apache.commons.lang.StringEscapeUtils |
This file contains 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
@Grapes( | |
@Grab(group='de.inetsoftware', module='jlessc', version='1.1') | |
) | |
import com.inet.lib.less.* | |
String lessContent = new File("example.less")?.text | |
Long time1 = new Date().time | |
String css = Less.compile( null, lessContent, true ); |
This file contains 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="org.seleniumhq.selenium", module="selenium-java", version="2.53.1") | |
import org.openqa.selenium.* | |
import org.openqa.selenium.remote.DesiredCapabilities | |
import org.openqa.selenium.remote.RemoteWebDriver | |
String USERNAME = "<USERNAME>" | |
String AUTOMATE_KEY = "<AUTOMATE_KEY>" | |
String URL = "https://" + USERNAME + ":" + AUTOMATE_KEY + "@hub-cloud.browserstack.com/wd/hub" |
This file contains 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
@GrabExclude('org.codehaus.groovy:groovy-all') | |
@Grab(group='org.spockframework', module='spock-core', version='1.1-groovy-2.4-rc-2') | |
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1') | |
import spock.lang.* | |
import groovyx.net.http.RESTClient | |
@Stepwise | |
class MyFirstSpec extends Specification { | |
@Shared |
This file contains 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
@Grapes([ | |
@Grab(group='org.grails', module='grails-web-common', version='3.1.10') | |
]) | |
import org.grails.web.json.JSONObject | |
import org.grails.web.json.JSONArray | |
String tagList = "tag1,tag2" | |
JSONObject jsonObject1 = new JSONObject([id:1,tags:tagList?.split(",")]) | |
assert jsonObject1.get("tags").size()==2 |
This file contains 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
@Grapes([ | |
@Grab(group='io.vertx', module='vertx-core', version='3.4.1'), | |
@Grab(group='io.vertx', module='vertx-lang-groovy', version='3.4.1') | |
]) | |
import io.vertx.core.* | |
import io.vertx.core.json.* | |
JsonObject jo1 = new JsonObject() | |
assert "jo1 is a ${jo1?.class?.name}" == "jo1 is a io.vertx.core.json.JsonObject" |
This file contains 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 fetch -p && git branch -r --list origin/\* | while read -r remote_branch; do git log -1 $remote_branch --pretty=format:'%ce';echo ;done | sort | uniq -c | awk '{printf("%s,%s\n",$2,$1)}' > output.csv |
This file contains 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 fetch -p && git branch -r --list origin/hotfix\* origin/feature\* origin/bugfix\* origin/chore\* | while read -r remote_branch; do if [ $(git log -1 $remote_branch --pretty=format:'%ce') == "your@email.com" ]; then echo $(git log -1 $remote_branch --pretty=format:'%d'); fi; done; |
This file contains 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
@Grapes([ | |
@Grab(group='com.google.cloud', module='google-cloud-storage', version='1.31.0'), | |
@Grab(group='com.google.auth', module='google-auth-library-credentials', version='0.9.1') | |
]) | |
import com.google.cloud.storage.Bucket; | |
import com.google.cloud.storage.BucketInfo; | |
import com.google.cloud.storage.Storage; | |
import com.google.cloud.storage.Storage.BucketGetOption; | |
import com.google.cloud.storage.Blob; | |
import com.google.cloud.storage.StorageOptions; |
This file contains 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
List<String> files = ["file1.properties", "file2.properties", "file3.properties"] | |
Long countWords(File propertiesFile) { | |
Long totalWords = 0 | |
try { | |
InputStream input = new FileInputStream(propertiesFile) | |
Properties prop = new Properties(); | |
OlderNewer