Skip to content

Instantly share code, notes, and snippets.

Avatar

John Rodriguez jrodbx

  • Square, Inc.
  • New York, NY
View GitHub Profile
View dump-agp-sources.gradle
/**
* 1) Change agpVersion
* 2) Run './gradlew dumpSources'
* 3) Check changeset into source control
*/
def agpVersion = 'UPDATE_THIS'
repositories {
google()
jcenter()
@jrodbx
jrodbx / kt2java_diff_hack.sh
Created Mar 8, 2019
Hack to enable better Java to Kotlin diffs
View kt2java_diff_hack.sh
#!/usr/bin/env bash
# Find all added *.kt files from last commit and mv to *.java
for f in $(git diff --name-status --diff-filter='A' HEAD~ "*.kt" | cut -f 2);
do mv -- "$f" "${f%.kt}.java";
done
# Commit the kt to java changes
git add .
git commit -m"kt to java"
View image_diff.sh
convert '(' ~/Desktop/before.png -flatten -grayscale Rec709Luminance ')' \
'(' ~/Desktop/after.png -flatten -grayscale Rec709Luminance ')' \
'(' -clone 0-1 -compose darken -composite ')' \
-channel RGB -combine ~/Desktop/diff.png
@jrodbx
jrodbx / build.gradle
Created Feb 14, 2019
Download AGP Sources
View build.gradle
def agpVersion = '3.5.0-alpha03'
repositories {
google()
jcenter()
}
configurations {
agp
}
@jrodbx
jrodbx / task_graph.groovy
Last active Feb 16, 2021
Graphviz visualization of a Gradle project's task graph
View task_graph.groovy
gradle.taskGraph.whenReady {
println "rootProject: " + rootProject.name
println "childProjects: " + rootProject.childProjects
def dot = new File(rootProject.buildDir, 'project.dot')
dot.delete()
def command = "./gradlew " + gradle.startParameter.getTaskNames().join(" ")
println "command: " + command
@jrodbx
jrodbx / geny.sh
Created Feb 3, 2017
Genymotion Emulator Starter
View geny.sh
#!/bin/bash
GMTOOL=/Applications/Genymotion.app/Contents/MacOS/gmtool
UUIDS=()
NAMES=()
INDEX=0
while read -r line; do
UUIDS[${#UUIDS[@]}]=$(echo -n $line | cut -f1 -d'|')
@jrodbx
jrodbx / YouTubeCrawler.java
Last active Aug 29, 2015
Google I/O 2014 YouTube video annotation easter egg crawler
View YouTubeCrawler.java
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.util.DateTime;
import com.google.api.services.youtube.YouTube;
import com.google.api.services.youtube.model.PageInfo;