Skip to content

Instantly share code, notes, and snippets.

View jrodbx's full-sized avatar

John Rodriguez jrodbx

View GitHub Profile
@jrodbx
jrodbx / gist:c7910b5dd1d0fbd8a04c5f7c35f5086d
Created September 16, 2023 21:09
JVM Option to debug another process (useful for IDE to IDE debugging)
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
@jrodbx
jrodbx / cashapp_gradle_enterprise.gradle
Last active October 7, 2023 02:29
Example Gradle Enterprise config
import groovy.json.JsonSlurper
import static java.nio.charset.Charset.defaultCharset
import static java.util.concurrent.TimeUnit.SECONDS
// Captures build and environment data and stores it in build scans via custom tags, links,
// and values, for one-off and trend analyses.
gradleEnterprise {
buildScan {
/**
* 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 March 8, 2019 03:58
Hack to enable better Java to Kotlin diffs
#!/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"
@jrodbx
jrodbx / image_diff.sh
Created February 19, 2019 08:29
image diff
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 February 14, 2019 05:59
Download AGP Sources
def agpVersion = '3.5.0-alpha03'
repositories {
google()
jcenter()
}
configurations {
agp
}
@jrodbx
jrodbx / task_graph.groovy
Last active September 8, 2022 18:29
Graphviz visualization of a Gradle project's task graph
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 February 3, 2017 11:07
Genymotion Emulator Starter
#!/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 August 29, 2015 14:00
Google I/O 2014 YouTube video annotation easter egg crawler
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;