Skip to content

Instantly share code, notes, and snippets.

Jeff Sheets jeffsheets

Block or report user

Report or block jeffsheets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jeffsheets / 1-websyncConfig.js
Last active Aug 13, 2019
AWS S3 Deploy sync w/ Cloudfront Invalidation and Cache-Control headers for Create-React-App
View 1-websyncConfig.js
//Config for s3 websync with cloudfront invalidation
// and Cache-Control headers for a Create-React-App application
module.exports = {
source: "build/",
target: `s3://yourcompany-us-east-1-${process.env.CI_ENVIRONMENT_NAME}-createreactapp/`,
invalidateDeletes: true,
modifiers: {
"static/**": { CacheControl: "max-age=31536000" },
jeffsheets / .env.development
Last active Jun 26, 2019
JS to read AWS SSM variables for use in Gitlab CI process
View .env.development
#This is used locally by Create-React-App during development
#Cognito Region
jeffsheets /
Last active Apr 23, 2019
Create React App CRA2 with react-intl i18n message extraction and translation

i18n Translations

To generate new translations:

  1. remove .messages folder
  2. Extract all messages into .messages dir with: yarn i18n:extract
  3. Add new messages into {lang}.json files with: yarn i18n:manageTranslations
  4. Translate any new entries in {lang}.json files and commit to repo (see Untranslated keys: output of previous command for list of keys needing translation)


jeffsheets / GroovySQLWithSpringDAO.groovy
Last active Oct 19, 2018
Using Groovy SQL with Spring configured Datasource to call complicated stored procedures with multiple ResultSets and multiple In and Out Params
View GroovySQLWithSpringDAO.groovy
class GroovySQLWithSpringDAO {
Sql groovySql
List<GroovyRowResult> findByFirstLast(String firstName, String lastName) {
GString statement = """{call FIND_BY_FIRST_LAST_SP (
${firstName}, ${lastName}, 'SYSUSER',
jeffsheets / ClientJWTService.groovy
Last active Oct 23, 2018
JWT creation in Spring Boot Groovy or Java with RSA 512 or 256 algorithm including steps to generate the keys stored as strings in yml properties file
View ClientJWTService.groovy
class ClientJWTService {
String publicKeyString
String privateKeyString
Algorithm buildJwtAlgorithm() {
KeyFactory kf = KeyFactory.getInstance('RSA')
jeffsheets / JsonDotNetLocalDateTimeDeserializer.groovy
Created Sep 26, 2018
Groovy Jackson Deserializer to convert a .NET style JSON dateTime to a Java LocalDateTime object
View JsonDotNetLocalDateTimeDeserializer.groovy
class JsonDotNetLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
LocalDateTime deserialize(JsonParser parser, DeserializationContext ctxt) {
* Returns a Java LocalDateTime when given a .Net Date String
* /Date(1535491858840-0500)/
jeffsheets / SpringConsulRibbonContextPathConfig.groovy
Created Jun 14, 2018
Spring Config for RestTemplate to use contextPath from Consul
View SpringConsulRibbonContextPathConfig.groovy
* Workaround to let RestTemplate use the contextPath from Consul when calling URLs
* (instead of only using the host and port)
* See
* Put this in any spring config class
LoadBalancerRequestTransformer consulContextPathTransformer() {
jeffsheets / PersonControllerIntProxiedSpec.groovy
Last active May 31, 2018
Spock 1.2 Spring Integration Test annotations SpringBean, SpringSpy, UnwrapAopProxy
View PersonControllerIntProxiedSpec.groovy
import org.springframework.test.util.AopTestUtils
/** Showing how to unwrap the AOP proxy manually to reuse the cached Spring context config */
class PersonControllerIntProxiedTest extends Specification {
@Autowired MockMvc mvc
/** A simple mock can just be autowired */
@Autowired ExternalRankingService externalRankingServiceMock
jeffsheets /
Last active May 31, 2018
Personal photo backup process

Personal Photo Backup Process

Just some notes so I can remember how I setup my phones to sync to my Crashplan backup on my PC


  • Backup pics from multiple iPhones
  • The backup should be wireless and automatic (or close)
  • Backup all files on PC to Crashplan
  • Extra points for backing up new photos to the same place as existing old photos and camera photos
jeffsheets /
Last active Apr 26, 2018
Bash Commands to Export Cert and Import into Java Truststore

Command to export a cert from a website to a .cer file (example uses Tested with git-bash shell on Windows. Assume similar on Mac?

openssl s_client -servername -connect </dev/null 2>/dev/null | openssl x509 -inform PEM -outform DER -out

Command to import into local java truststore (use your own location of JAVA_HOME)

"$JAVA_HOME"/bin/keytool -keystore "$JAVA_HOME"/jre/lib/security/cacerts -importcert -alias -file

You can’t perform that action at this time.