Skip to content

Instantly share code, notes, and snippets.

View TheMetalCode's full-sized avatar

Jason Hagglund TheMetalCode

View GitHub Profile
@TheMetalCode
TheMetalCode / README.md
Last active January 27, 2020 18:59
Extract The High-Level Coverage Stats from a Jacoco HTML Report

Let's say the following describes your situation:

  • You're using JaCoCo to measure code coverage for a Java/Kotlin project (eg an Android app), a perfectly good tool for the job that unfortunately does not generate JSON reports.
  • You're using a 3rd party SaaS provider like CircleCI, which can sometimes perform unpredictably when uploading large amounts of files to build artifact storage. Things like HTML coverage reports from JaCoCo, for instance.
  • As a result you'd like to zip the HTML report prior to saving it to artifacts but would still like the high-level coverage stats to be made transparent without having to download and unzip the HTML report.

If you're in this boat along with me, here is one way you might go about extracting this infromation from the html report.

The risk here is that this is theoretically brittle - it's tied to whatever the DOM happens to be for the HTML that JaCoCo generates. In reality, it hasn't changed in quite some time. YMMV.

@TheMetalCode
TheMetalCode / A_Way_To_Mostly_Automate_FastlaneSession_Update.md
Last active June 17, 2022 19:21
Mostly Automated Way to Update FASTLANE_SESSION

fastlane/fastlane#13833

This script may be useful to you if you use fastlane for iOS CI builds and your Apple developer portal account uses 2-factor authentication. There is reason to suppose that Apple may not be persisting these sessions for as long as they used to, and hence you might find yourself needing to update FASTLANE_SESSION for your CI projects more often than usual.

This script is a way to mostly automate the process of updating FASTLANE_SESSION if you use CircleCI as your CI provider. It expects to find your Apple username in env as FASTLANE_USER, your Apple password as FASTLANE_PASSWORD, and your CircleCI API token as CIRCLE_API_TOKEN. It then executes fastlane spaceauth and waits for you to put in your 2FA code. From there, it parses out the session data and then uses the CircleCI API to populate the specified projects with the newly updated FASTLANE_SESSION. You'll

Keybase proof

I hereby claim:

  • I am themetalcode on github.
  • I am hagglundized (https://keybase.io/hagglundized) on keybase.
  • I have a public key ASAdDCG9jbjF7lJBWE-UJ6G59In8ZjdSVlrLOmtG-0AEqwo

To claim this, I am signing this object:

@TheMetalCode
TheMetalCode / browsermob-proxy.rb
Last active June 22, 2017 00:31
homebrew formula browsermob-proxy
require "formula"
class BrowsermobProxy < Formula
homepage "http://bmp.lightbody.net/"
url "https://github.com/lightbody/browsermob-proxy/releases/download/browsermob-proxy-2.1.4/browsermob-proxy-2.1.4-bin.zip", :using => :curl
sha256 "27c4080411adff919586e909c664c73bebb8ba8bfcaea259ce58327222e5e8fb"
version "2.1.4"
def install
prefix.install Dir["*"]
end
@TheMetalCode
TheMetalCode / keybase.md
Created July 14, 2014 21:37
keybase.md

Keybase proof

I hereby claim:

  • I am TheMetalCode on github.
  • I am hagglundized (https://keybase.io/hagglundized) on keybase.
  • I have a public key whose fingerprint is 3041 D13E 581B 55D9 A0EC AA97 7401 7AF5 D737 A355

To claim this, I am signing this object: