Skip to content

Instantly share code, notes, and snippets.

@mashbourne
mashbourne / aws cross account role use.java
Created February 3, 2018 01:04
aws cross account role use
new STSAssumeRoleSessionCredentialsProvider.Builder(roleArn, "my-cross-account-session").build()
@mashbourne
mashbourne / README.md
Created November 9, 2017 06:20 — forked from kmader/README.md
Beating Serialization in Spark

Serialization

As all objects must be Serializable to be used as part of RDD operations in Spark, it can be difficult to work with libraries which do not implement these featuers.

Java Solutions

Simple Classes

For simple classes, it is easiest to make a wrapper interface that extends Serializable. This means that even though UnserializableObject cannot be serialized we can pass in the following object without any issue

public interface UnserializableWrapper extends Serializable {
 public UnserializableObject create(String parm1, String parm2);
@mashbourne
mashbourne / add_pre-commit_npm_test.sh
Created April 12, 2016 15:32
Run npm test before git commit
mkdir .git/hooks; touch .git/hooks/pre-commit; chmod +x .git/hooks/pre-commit; echo "PATH=$PATH:/usr/local/bin:/usr/local/sbin; npm test" > .git/hooks/pre-commit