Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding (and hiring! reach out)

Erik Schultink eschultink

💻
Coding (and hiring! reach out)
View GitHub Profile
@eschultink
eschultink / .gitconfig
Created Sep 25, 2018
Alias section of my .gitconfig
View .gitconfig
[alias]
# find when commits were merged
# USAGE:
# git find-merge <SHA-1> // when merged to current branch
# git find-merge <SHA-1> master // when merged to master
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
@eschultink
eschultink / AcmeServlet.java
Last active Nov 14, 2017
Servlet to support Automatic Certificate Management Environment (ACME) challenges on Google App Engine, as needed for Let's Encrypt. see: https://github.com/ietf-wg-acme/acme/
View AcmeServlet.java
package co.worklytics.acme;
import com.google.appengine.api.datastore.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@eschultink
eschultink / BaseServlet.java
Created Apr 1, 2015
Dagger for a Servlet Example
View BaseServlet.java
import dagger.ObjectGraph;
public abstract class BaseServlet extends HttpServlet {
private ObjectGraph graph;
/**
* inits the Servlet with the object graph from Dagger
* if you override this, be sure your implementation calls that of this super class
*
* @param config