- Build scripts and tooling written in Groovy are often hard to configure, hard to refactor, and non-idiomatic.
- Type-safe build logic
- IDE support
- Code completion
- Documentation
- IDE support
- Refactoring
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
// Converts a Caviar group order link to a shareable link | |
function copyText(a){ | |
var b=document.createElement("textarea"); | |
c=document.getSelection(); | |
b.textContent=a; | |
document.body.appendChild(b); | |
c.removeAllRanges(); | |
b.select(); | |
document.execCommand("copy"); |
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
configurations.all { | |
resolutionStrategy { | |
force "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion" | |
} | |
} |
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
import com.google.common.base.Throwables; | |
try { | |
// Try a thing | |
} catch (Exception e) { | |
Throwable rootCause = Throwables.getRootCause(e); | |
} | |
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
#!/bin/bash -eux | |
# This script iterates over a Kinesis stream and dumps out the records. | |
# I used it to test whether items were getting pushed to my stream. | |
# Requires jq. | |
AWS_PROFILE=dev | |
AWS_REGION=us-east-1 | |
SHARD_ID=myShard | |
STREAM_NAME=myStream |
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
# Run Redis locally, with restarts enabled, and forward default ports to it | |
docker run -p 6379:6379 --restart=always -d redis redis-server --appendonly yes |
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
#!/bin/bash | |
# Note: This script requires that you have $GITHUB_TOKEN set. | |
# Get one here: https://github.com/settings/tokens | |
ORG=yourOrg | |
HAS_NEXT=true | |
i=1 | |
while $HAS_NEXT |
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
docker run -ti -v $PWD:/app ruby /bin/bash | |
# Then `gem install travis` and you'll be good to go. |
In TestNG's assertEquals
method, it's easy to confuse which parameter represents the expected value, and which one represents the actual value.
@Test(groups = INTEGRATION_GROUP)
public void assertEqualsTest(){
String expected = "expected";
String actual = "actual";
assertEquals(actual, expected);
}
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
@Wither(onMethod = @__({@VisibleForTesting})) | |
private String myString; |