Skip to content

Instantly share code, notes, and snippets.

View AndrewReitz's full-sized avatar

Andrew Reitz AndrewReitz

View GitHub Profile
AndrewReitz /
Last active January 2, 2016 07:29
Quick and dirty way to add a water mark to all images in a folder.
WATERMARK="$1" #1st param image to be the water mark
#2nd param is path to folder you want all jpg, jpeg or png to
#have the water mark added to
for image in $2/*{.jpg,.jpeg,.png}
#gravity is the position the water mark will go
#50 is the opacity of the image
#the second $image is the output file, currently
AndrewReitz / .bashrc
Last active January 2, 2016 10:59
My .bashrc so I can add things and remember them elsewhere
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
# User specific aliases and functions
AndrewReitz / downloadtable.js
Created January 8, 2014 03:39
Download a table on a website with JavaScript
// Place to store all the strings for the CSV
var stringBuilder = [];
// Get the table, this one happens to be adminlist
// Could probably make the more generic
var table = document.getElementsByClassName('adminlist')[0];
var tbody = table.getElementsByTagName('tbody')[0]
var rows = tbody.getElementsByTagName('tr');
// Loop through each row
AndrewReitz /
Last active January 3, 2016 02:29
Generic Types Example Problem (INCOMPLETE)
public class GenericsExampleProblem {
public static void main(String[] args) {
Class myClass = MyClass.class;
Method[] myClassMethods = myClass.getDeclaredMethods();
for (Method method : myClassMethods) {
// Skip any other methods
// This must be done this way instead of with getMethod(String Name, Class<?>... params) since
// we can not possibly know the params until at run time
if (!method.getName().equals("myMethod")) {
AndrewReitz /
Last active April 23, 2020 21:14
How to install Netflix on Fedora and Ubuntu
AndrewReitz /
Created March 18, 2014 01:12
Keybase verification

Keybase proof

I hereby claim:

  • I am pieces029 on github.
  • I am areitz ( on keybase.
  • I have a public key whose fingerprint is 6513 2A0E 64C9 3BC1 EDB4 BA62 0221 9C76 97C0 FB6E

To claim this, I am signing this object:

AndrewReitz /
Created June 16, 2014 23:16
RxJava implementation of Fibonacci Number
public class Main {
public static void main(String[] args) {
rxFibN(20).subscribe(new Action1<Integer>() {
@Override public void call(Integer result) {
static Observable<Integer> rxFibN(final int n) {
AndrewReitz /
Created June 21, 2014 12:51
Crashlytics Tree
public final class CrashlyticsTree extends HollowTree {
private static final Pattern ANONYMOUS_CLASS = Pattern.compile("\\$\\d+$");
private enum LogLevel {
@Override public void i(String message, Object... args) {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
AndrewReitz / gist:01a3e098b95ecb83fda0
Created July 17, 2014 16:10
Linux Upfind + Gradlew
# Find something in a directory above the one you are in
function upfind() {
while [ "$dir" != "/" ]; do
path=`find "$dir" -maxdepth 1 -name $1`
if [ ! -z $path ]; then
echo "$path"
dir=`dirname "$dir"`