Skip to content

Instantly share code, notes, and snippets.

Connor Boyd connorboyd

Block or report user

Report or block connorboyd

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
@connorboyd
connorboyd / SystemDateProvider.java
Created Jan 16, 2019
Second SystemDateProvider code snippet for Wealthfront engineering blog
View SystemDateProvider.java
@Singleton
public class SystemDateProvider implements Provider<LocalDate> {
 private final Supplier<LocalDate> supplier =
   Suppliers.memoizeWithExpiration(this::loadSystemDate, 1, MINUTES);
 private LocalDate loadSystemDate() {
   // Load from database
 }
@connorboyd
connorboyd / SystemDateProvider.java
Last active Jan 16, 2019
First SystemDateProvider code snippet for Wealthfront engineering blog
View SystemDateProvider.java
public class SystemDateProvider implements Provider<LocalDate> {
 private final Supplier<LocalDate> supplier =
   Suppliers.memoizeWithExpiration(this::loadSystemDate, 1, MINUTES);
 private LocalDate loadSystemDate() {
   // Load from database
 }
 @Override
@connorboyd
connorboyd / TransactionConverter.java
Created Jan 16, 2019
TransactionConverter code snippet for wealthfront engineering blog post
View TransactionConverter.java
@Singleton
public class TransactionConverter {
@Inject @SystemDate Provider<LocalDate> systemDateProvider;
TransactionEntry convertTransaction(Transaction transaction) {
LocalDate systemDate = systemDateProvider.get();
// Convert transaction...
}
You can’t perform that action at this time.