Skip to content

Instantly share code, notes, and snippets.

View AndrewReitz's full-sized avatar

Andrew Reitz AndrewReitz

View GitHub Profile
@AndrewReitz
AndrewReitz / main.py
Created March 10, 2022 15:54
Python gradle.kts to libs.version.toml script
import pyperclip
import time
import re
reg = re.compile("\"[A-Za-z0-9:-]+\"")
while True:
inp = pyperclip.paste()
t = reg.findall(inp)
@AndrewReitz
AndrewReitz / README.md
Created November 15, 2017 21:50
ZarZaring the Groovy Jar for Android 26+
  1. Download JarJar jar
  2. In the same folder download the grooid jar you want to use. This was tested with 2.4.12 jar
  3. Again, in the same folder create a file called rules.txt
  4. In rules.txt put "zap org.codehaus.groovy.vmplugin.v7.IndyInterface"
  5. Run java -jar jarjar-1.3.jar process rules.txt groovy-2.4.12-grooid.jar groovy-android.jar
  6. Now add newly created jar file to your android project.

Keybase proof

I hereby claim:

  • I am AndrewReitz on github.
  • I am areitz (https://keybase.io/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:

package com.smartthings.android.common.http;
import com.inkapplications.preferences.IntPreference;
import com.smartthings.android.di.annotation.HttpDisasterRate;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Protocol;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.Response;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.ResponseBody;
@AndrewReitz
AndrewReitz / lol.groovy
Created March 3, 2015 21:26
How much do you hate me now?
char z = Character.class.getDeclaredMethods()[0].toString().charAt(6)
char x = javax.sql.RowSet.class.getName().charAt(5)
Object o = ClassLoader.getSystemClassLoader()
.loadClass(
javax.crypto.Cipher.class.getName().split(String.format("\\%s", x))[0].substring(0, 4) +
x +
java.lang.annotation.Annotation.class.getName().split(String.format("\\%s", x))[1] +
x +
Character.toUpperCase(java.sql.Connection.class.getName().split(String.format("\\%s", x))[1].charAt(0)) +
@AndrewReitz
AndrewReitz / ಠ__ಠ.java
Last active August 29, 2015 14:10
@ಠ__ಠ
package lol;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
@AndrewReitz
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() {
dir=`pwd`
while [ "$dir" != "/" ]; do
path=`find "$dir" -maxdepth 1 -name $1`
if [ ! -z $path ]; then
echo "$path"
return
fi
dir=`dirname "$dir"`
@AndrewReitz
AndrewReitz / keybase.md
Created March 18, 2014 01:12
Keybase verification

Keybase proof

I hereby claim:

  • I am pieces029 on github.
  • I am areitz (https://keybase.io/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
AndrewReitz / watermark.sh
Last active January 2, 2016 07:29
Quick and dirty way to add a water mark to all images in a folder.
#!/bin/bash
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}
do
#gravity is the position the water mark will go
#50 is the opacity of the image
#the second $image is the output file, currently