Skip to content

Instantly share code, notes, and snippets.

View fastnsilver's full-sized avatar

Chris Phillipson fastnsilver

View GitHub Profile
#!/bin/bash
# A curated collection of software to be installed via Homebrew
# @author Chris Phillipson
# @lastUpdated 2017-05-04
# @version 1.0
# @see http://brew.sh/, https://caskroom.github.io/
set -e
# Install Homebrew
@fastnsilver
fastnsilver / AwsMetricCollectionRequest.java
Created May 1, 2017 17:32
Working w/ Spring Cloud and SQS
import java.util.List;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.json.JSONArray;
@fastnsilver
fastnsilver / README.md
Last active April 13, 2017 18:08
How to get SpringSource ToolSuite to respect .bash_profile in Terminal view
@fastnsilver
fastnsilver / .bash_profile
Last active November 4, 2016 22:40
Mac OS - .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@fastnsilver
fastnsilver / brew-me.sh
Last active June 5, 2017 16:02
Mac OS - Homebrew - Developer bootstrap
#!/bin/bash
# A curated collection of software to be installed via Homebrew
# @author Chris Phillipson
# @lastUpdated 2017-06-05
# @version 1.2
# @see http://brew.sh/, https://caskroom.github.io/, and https://github.com/cloudfoundry/homebrew-tap
set -e
@fastnsilver
fastnsilver / SpringIntegrationManagementMetrics.java
Last active October 30, 2020 21:09
Spring Integration Management metrics exposed as Spring Boot Actuator PublicMetrics
public class SpringIntegrationManagementMetrics implements PublicMetrics, ApplicationContextAware {
private ApplicationContext applicationContext;
@Override
public Collection<Metric<?>> metrics() {
Collection<Metric<?>> result = new LinkedHashSet<Metric<?>>();
// Collect Spring Integration metrics; if available
// keys in each map are the bean names
@fastnsilver
fastnsilver / AmazonS3InboundSynchronizationMessageSourceConfig.java
Created September 11, 2015 17:11
Spring Integration AWS configuration fragment for synchronizing an S3 bucket directory
@Bean
public MessageSource<?> amazonS3InboundSynchronizationMessageSource() {
AWSCredentials credentials = new BasicAWSCredentials(this.accessKey, this.secretKey);
AmazonS3InboundSynchronizationMessageSource messageSource = new AmazonS3InboundSynchronizationMessageSource();
messageSource.setCredentials(credentials);
messageSource.setBucket(bucket);
messageSource.setMaxObjectsPerBatch(maxObjectsPerBatch);
messageSource.setAcceptSubFolders(Boolean.valueOf(acceptSubFolders));
messageSource.setRemoteDirectory(remoteDirectory);
if (!fileNameWildcard.isEmpty()) {
@fastnsilver
fastnsilver / LoggingUtils.java
Created September 11, 2015 17:07
Spring Integration Utility for logging messages
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.interceptor.WireTap;
import org.springframework.integration.handler.LoggingHandler;
import org.springframework.messaging.MessageChannel;
public final class LoggingUtils {
private static final String DEFAULT_MESSAGE = "'Message: [' + #root + ']'";
private LoggingUtils() {
@fastnsilver
fastnsilver / HikariDataSourceConfig.java
Created September 2, 2015 13:37
How to have Hikari take precendence as DataSource connection pool in a Sprint Boot app
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.codahale.metrics.MetricRegistry;
import com.zaxxer.hikari.HikariDataSource;
@Configuration