Skip to content

Instantly share code, notes, and snippets.

@franklsm1
franklsm1 / _setupSteps.md
Created May 14, 2020 02:14
Set up Java linter using checkstyle

Java Linting w/ Checkstyle

Setup Steps

  1. Add a "config" directory to the top level of your Gradle Java app
  2. Add a "checkstyle" sub directory under the newly created "config" directory
  3. Add the below checkstyle.xml file under that directory so that the structure is: config/checkstyle/checkstyle.xml
  4. Add the checkstyle plugin to your plugins block in the build.gradle
@franklsm1
franklsm1 / INSTRUCTIONS.md
Last active March 21, 2024 19:10
Auto configure pre-commit hooks for a Gradle Spring App

Steps

  1. create a file called "pre-commit" with no extension in the project directory root
  2. add the code from the pre-commit file below into that new file
  3. create a new file called "preCommit.gradle" inside of the root gradle folder
  4. add the code from the preCommit.gradle file below into that new file
  5. 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.

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
@franklsm1
franklsm1 / questionableCode.js
Last active July 12, 2019 02:23
A bunch of questionable / controversial code examples
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
/*******************************************/
@franklsm1
franklsm1 / renderPropConversion.js
Created August 3, 2018 03:28
Before and After render prop example
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,