Skip to content

Instantly share code, notes, and snippets.

View ejwinter's full-sized avatar

Eric J. Winter ejwinter

View GitHub Profile
@ejwinter
ejwinter / ConsolidatingDuplicateVariants-MongoDB.js
Created January 9, 2020 15:35
Iron out duplicate fields in a collection and update marker fields
function reorderProperties(obj) {
var sortedObj = {};
Object.keySet(obj).sort().forEach(key => {
sortedObj[key] = obj[key];
});
return sortedObj;
};
db.SimpleVariants.updateMany({}, { $unset: { "qualifiers": 1, "coordinates.hg19.qualifiers": 2, "coordinates.rcrs.qualifiers": 3 } });
@ejwinter
ejwinter / auth-http-interceptor.service.ts
Last active June 27, 2019 12:09
A service to perform login and logout and an http interceptor to use the users token to authenticate each request.
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest,} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {Credentials} from "app/shared/security/credentials";
import {Observable, throwError} from "rxjs";
import {concatMap, take, tap} from "rxjs/operators";
import {CredentialService} from "app/shared/service/credential.service";
@Injectable()
export class AuthHttpInterceptor implements HttpInterceptor {
@ejwinter
ejwinter / ExcelToTable.java
Last active August 10, 2023 02:39
Turn an Excel (xlsx) file with a single table in it into a Guava table with a header indexed
/**
* This class takes an Excel spreadsheet and converts it into a Guava Table format.
* When other formats of the file are to be supported (like CSV, TSV etc.,) implement the apply method with that format.
*/
@Component
public class ExcelToTableLoader implements TableGenerator<File> {
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(ExcelToTableLoader.class);
@ejwinter
ejwinter / 12StoriesForArchitects.md
Created March 6, 2017 12:33
Stories Every Architect Should Know #notes #nfjs

Stories Every Architect Should Know

Neal Ford

Job of the architect

Take business requirements plus a lot of other -ilities to solve a problem.

You need to revaluate abilities (-ililties).

Architects must be able to say "No" gracefully.

#Documenting Software Architecture Neal Ford

The presentation started out talking about architecture but ended up primarily discussing presentation patterns and styles. Not a bad talk but not what I was expecting or hoping for.

Weighing Architecture

How do you balance architecture and working software.

Twelve way to make code suck less

Why should we care about code quality?

  • we can't be agile if our code sucks
  • "Code is how we tell our colleagues how we feel about them"
    • "I hate you."
    • "I love you."
  • http://wiki.c2.com/?FirstLawOfProgramming "Lowering quality lengthens development time."

What is quality Code?

An architects guide to evaluating cloud services

Matt Stine

War stories on how he has gone about doing things over the past years.

Topics

  • Rationale
  • Evaluation categories
    • Business case
  • Resiliency

Analyzing Software Architectural

Mark Richards

Agenda

  • Intro
  • Architecture and structural decay
  • Metrics and structural decay
  • Architecture analysis tools (x ray, code city, source monitor)

Analyzing

import concurrent.ParallelStreams;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
package edu.mayo.cim.mxd.fileloader;
import com.google.common.base.Splitter;
import com.google.common.collect.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**