Bookmarks Toolbar__firefox-test-items__ tag = TERM & in toolbar🏷__zzzz🏷__firefox-test-bookmark__ tag = "__notTERM" & in toolbar🏷__not__zzzz🏷__firefox-test-bookmark
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
| /** | |
| * Class Wrapper allows to wrap and execute variable number of nested Closures. | |
| * Immediately-wrapped closure is accessible inside the wrapper as variable `_`. | |
| */ | |
| final class Wrapper { | |
| private final List stack = [] | |
| Wrapper leftShift(Closure c) { | |
| c.resolveStrategy = Closure.DELEGATE_FIRST | |
| stack << c |
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
| String getHostFromUrl(String url) { | |
| url | |
| .replaceAll('^[a-z]+://', '') | |
| .replaceAll('(/.*)?$', '') | |
| .replaceAll('(:[0-9]+)?$', '') | |
| } | |
| def getHostFromUrlSpec() { | |
| expect: | |
| getHostFromUrl('https://example.com:9999/path.ext') == 'example.com' |
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
| String f(Object... varArgs) { | |
| List args = varArgs == null ? [null] : varArgs | |
| Map named = args | |
| ? (args[0] instanceof Map ? args[0] : [:]) | |
| : [:] | |
| List positional = named ? args.drop(1) : args | |
| "named: $named; positional: $positional; all: $args" | |
| } |
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
| function __generate() { | |
| typeset -A themes=( | |
| [molokai]="no=0:di=0;38;2;102;217;239:ln=0;38;2;249;38;114:ow=0:so=0;38;2;0;0;0;48;2;249;38;114:fi=0:tw=0:ex=1;38;2;249;38;114:mi=0;38;2;0;0;0;48;2;255;74;68:*~=0;38;2;122;112;112:pi=0;38;2;0;0;0;48;2;102;217;239:or=0;38;2;0;0;0;48;2;255;74;68:cd=0;38;2;249;38;114;48;2;51;51;51:bd=0;38;2;102;217;239;48;2;51;51;51:st=0:*.r=0;38;2;0;255;135:*.t=0;38;2;0;255;135:*.o=0;38;2;122;112;112:*.a=1;38;2;249;38;114:*.d=0;38;2;0;255;135:*.h=0;38;2;0;255;135:*.m=0;38;2;0;255;135:*.p=0;38;2;0;255;135:*.z=4;38;2;249;38;114:*.c=0;38;2;0;255;135:*.td=0;38;2;0;255;135:*.hs=0;38;2;0;255;135:*.mn=0;38;2;0;255;135:*.jl=0;38;2;0;255;135:*.ui=0;38;2;166;226;46:*.pl=0;38;2;0;255;135:*.ml=0;38;2;0;255;135:*.py=0;38;2;0;255;135:*.kt=0;38;2;0;255;135:*.el=0;38;2;0;255;135:*.ps=0;38;2;230;219;116:*.cc=0;38;2;0;255;135:*.gv=0;38;2;0;255;135:*.ts=0;38;2;0;255;135:*.vb=0;38;2;0;255;135:*.rb=0;38;2;0;255;135:*.di=0;38;2;0;255;135:*.rs=0;38;2;0;255;135:*.pp=0;38;2;0;255;135:*.xz=4;38;2;2 |
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
| void withOptionalDocker(String dockerImageName, Closure body) { | |
| (dockerImageName | |
| ? { c -> withDockerContainer(image: dockerImageName) {c()} } | |
| : { c -> c() } | |
| )(body) | |
| } | |
| withOptionalDocker(shouldUseDocke() ? 'my-image' : null) { | |
| sh 'doSomething' | |
| } |
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.json.JsonGenerator | |
| import groovy.json.JsonOutput | |
| /** | |
| * Inspects big objects | |
| * Usage: | |
| * println Inspect.unwrapAsJsonWithProperties(sourceSets, 3) | |
| * println Inspect.unwrapAsJsonWithProperties(sourceSets.main.allSource, 2, 150) | |
| * println Inspect.unwrapAsJson(sourceSets.main, 2, 120) | |
| */ |
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
| plugins { | |
| id 'groovy' | |
| } | |
| sourceSets { | |
| // ... | |
| } |