Skip to content

Instantly share code, notes, and snippets.

@dlew
dlew / script.sh
Created November 9, 2018 16:36
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: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# 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`.
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:
-----------
@cketti
cketti / ContentUriRequestBody.kt
Created March 27, 2019 14:59
Implementation of OkHttp's RequestBody that supports Android's content:// URIs
import android.content.ContentResolver
import android.net.Uri
import okhttp3.MediaType
import okhttp3.RequestBody
import okio.BufferedSink
import okio.Okio
import java.lang.IllegalStateException
class ContentUriRequestBody(
private val contentResolver: ContentResolver,
@sysboss
sysboss / sonar.md
Last active April 21, 2022 15:24
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