Skip to content

Instantly share code, notes, and snippets.

cketti / ContentUriRequestBody.kt
Created Mar 27, 2019
Implementation of OkHttp's RequestBody that supports Android's content:// URIs
View ContentUriRequestBody.kt
import android.content.ContentResolver
import okhttp3.MediaType
import okhttp3.RequestBody
import okio.BufferedSink
import okio.Okio
import java.lang.IllegalStateException
class ContentUriRequestBody(
private val contentResolver: ContentResolver,
dlew /
Created Nov 9, 2018
Simple AndroidX Migration Script
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
# You can download a CSV of package names here:
# It'll run faster on a clean build because then there are fewer files to scan over.
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.
sysboss /
Last active Jun 8, 2021
SonarQube on AWS EC2 - Installation and integration with Jenkins

This article will briefly describe how to install SonarQube as Docker container on Amazon EC2 and integrate it with Jenkins.

Create database instance and user

Go to RDS > Parameter Groups
Create a new Parameter Group with the following parameter:

max_allowed_packet = 268435456

We need to create a new RDS database for SonarQube (you may use an existing MySQL instance)

  1. Go to RDS Instances
View Android Color Control Cheat Sheet
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views: