-X {method}where method is {GET,POST,HEAD,etc.} (Default: GET)-vverbose mode-o to_file/-Osave output to_file or use server-provided filename-
-Juse filename from header
-Lfollow Location header when 3xx code returns-#/--progress-baruse simple progress bar (single-line) instead of default download info-ssilent mode
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 tmpl = { | |
| """ | |
| <appender name="${it.toUpperCase()}_FILE" | |
| additivity="false" | |
| class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| <file>\${LOG_PATH}/${it.toLowerCase()}.log</file> | |
| <encoder><pattern>\${FILE_LOG_PATTERN}</pattern></encoder> | |
| <append>true</append> | |
| <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| <fileNamePattern>\${LOG_PATH}/old/${it.toLowerCase()}_%d{yyyy-MM-dd, aux}/${it.toLowerCase()}.%d{yyyy-MM-dd-HH}.gz</fileNamePattern> |
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.transform.Canonical | |
| import java.util.concurrent.CompletableFuture | |
| import java.util.function.Function | |
| import java.util.function.Supplier | |
| final long serviceExecutionTime = 1000 | |
| def rand = new Random() | |
| def initVal = rand.nextInt(100) |
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 java.util.concurrent.CompletableFuture | |
| import java.util.concurrent.TimeUnit | |
| import java.util.function.Supplier | |
| Supplier treeItemSupp = { sleep(50); '`treeItem`' } | |
| Supplier eventItemSupp = { sleep(100); ' `event`'; new RuntimeException('bam!') } | |
| Supplier l10nItemSupp(String treeItem) { return {sleep(200); " `l10n($treeItem)`"} as Supplier } | |
| CompletableFuture.supplyAsync(treeItemSupp) | |
| .thenCompose({ str -> |
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
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-compiler-plugin</artifactId> | |
| <version>3.5.1</version> | |
| <configuration> | |
| <source>1.8</source> | |
| <target>1.8</target> | |
| <compilerId>groovy-eclipse-compiler</compilerId> | |
| <verbose>false</verbose> | |
| </configuration> |
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
| -- table.filter({"a", "b", "c", "d"}, function(o, k, i) return o >= "c" end) --> {"c","d"} | |
| -- | |
| -- @FGRibreau - Francois-Guillaume Ribreau | |
| -- @Redsmin - A full-feature client for Redis http://redsmin.com | |
| table.filter = function(t, filterIter) | |
| local out = {} | |
| for k, v in pairs(t) do | |
| if filterIter(v, k, t) then out[k] = v end | |
| end |
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 org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| import org.springframework.context.support.GenericGroovyApplicationContext | |
| interface ServiceInParent { | |
| String invokeParent() | |
| } | |
| class ChildService { | |
| ServiceInParent serviceInParent |
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 org.springframework.context.support.GenericXmlApplicationContext | |
| import org.springframework.core.io.ByteArrayResource | |
| import org.springframework.integration.support.MessageBuilder | |
| import org.springframework.messaging.MessageChannel | |
| def xml = '''<?xml version="1.0" encoding="UTF-8"?> | |
| <bean:beans xmlns="http://www.springframework.org/schema/integration" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:bean="http://www.springframework.org/schema/beans" |
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
| FILE='' | |
| FILTER_EXPR='' | |
| DELIM=' ' | |
| # col num -- 3, change if need another | |
| cat $FILE |grep $FILTER_EXPR|awk -F"$DELIM" '{print $3}'|sort|uniq -c> result.txt |
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 com.google.common.collect.TreeTraverser | |
| // format (id/parentId) | |
| def data = [ | |
| '1/0', | |
| '2/1', '3/1', | |
| '4/2', '5/2', '6/3', | |
| '7/5', '8/5', '9/6' | |
| ] |