Skip to content

Instantly share code, notes, and snippets.

View AbuCarlo's full-sized avatar

Anthony Nassar AbuCarlo

View GitHub Profile
@AbuCarlo
AbuCarlo / SetWithRangeSumsStressTester.groovy
Created December 27, 2018 19:10
This Groovy script can be used to generate stress tests for the final week's assignment for the Coursera course `Basic Algorithms`
def UPPER_BOUND = 1000001 // SetWithRangeSums.MODULUS
def PROBLEM_SIZE = 100000
def javaSet = new SetWithRangeSums.SummingTreeSet()
def avlSet = new SetWithRangeSums.PrincetonAvlTree()
/* The inputs from the assignment are about 45 % insertion, 45 % queries, 5 % deletion,
and 5% range sums.
*/
@AbuCarlo
AbuCarlo / SerializeInstantInJson.groovy
Created June 23, 2019 18:16
Jackson Serialization of Temporal Types
@Grapes([
@Grab(group='com.fasterxml.jackson.core', module='jackson-core', version='2.9.9'),
@Grab(group='com.fasterxml.jackson.datatype', module='jackson-datatype-jsr310', version='2.9.9')
]
)
import java.time.*
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
@AbuCarlo
AbuCarlo / InstallToGrape.md
Created June 23, 2019 18:17
Downloading to Maven Cache, Then Copy to Grape

Installing to Maven Cache, then Grapes

mvn dependency:get org.xerial.snappy:snappy-java:1.0.5
grape install org.xerial.snappy snappy-java 1.0.5

mvn dependency:tree -Dincludes=ch.qos.logback

@AbuCarlo
AbuCarlo / HowToCreateATruststore.md
Created June 23, 2019 18:18
Creating a Truststore for Deployed App

How to Create a Truststore for Deployed Applications

If your service is going to call other services in CapitalOne, esp. the DevEx gateway, your JVM will have to trust hosts within capitalone.com. The usual way that devs do this is simply to get the Capital One root cert from another dev, and import it into their $JAVA_HOME.../cacerts. This is unwise for EC2 instances. Your cacerts is probably cluttered with other certs, and for deployment, you'd really like know exactly what you're doing, not throw files onto an instance and hope they work.

The better practice would be to create a truststore that has no more information in it than your application needs. Create an empty truststore: