- Add a "config" directory to the top level of your Gradle Java app
- Add a "checkstyle" sub directory under the newly created "config" directory
- Add the below checkstyle.xml file under that directory so that the structure is:
config/checkstyle/checkstyle.xml
- Add the
checkstyle
plugin to yourplugins
block in thebuild.gradle
- create a file called "pre-commit" with no extension in the project directory root
- add the code from the pre-commit file below into that new file
- create a new file called "preCommit.gradle" inside of the root
gradle
folder - add the code from the preCommit.gradle file below into that new file
- add the following line at the end of the build.gradle file:
apply from: "$projectDir/gradle/preCommit.gradle"
Now when you run the ./gradlew build
command the git pre-commit hook will be automatically setup.
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
const baseTwitterSearchUrl = 'https://api.twitter.com/1.1/search/tweets.json'; | |
const defaultFetchOptions = { | |
method: 'GET', | |
headers: { | |
'Authorization': `Bearer ${process.env.TWITTER_BEARER_TOKEN}`, | |
}, | |
}; | |
/* | |
* This function will call the standard Twitter search API finding non retweeted tweets starting |
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
const valuableQuoteToShareBeforeSession = | |
"Remember, before you can be great, you've got to be good." + | |
"Before you can be good, you've got to be bad." + | |
"But before you can even be bad, you've got to try." + | |
"– Art Williams" | |
/*******************************************/ | |
// useless assignment and error messsage | |
/*******************************************/ |
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 React from "react"; | |
import PropTypes from "prop-types"; | |
/* | |
* Example CarsList with no reusable code that may be duplicated elsewhere | |
*/ | |
class CarsList extends React.Component { | |
state = { | |
cars: [], | |
isLoading: false, |