Skip to content

Instantly share code, notes, and snippets.

View jaswanthm's full-sized avatar

Jaswanth jaswanthm

View GitHub Profile
@brettwold
brettwold / README.md
Last active July 21, 2021 02:26
Upload APK file S3 bucket

Publish Android APKs to S3

Usage

Setup your S3 variables. Highly recommend that the access key and id are referred to as environment variables then they don't end up in your source repo. The snippet below sets up the variables for all projects in your build but you can do it on an individual project basis as well if you prefer.

allprojects {
@yorammi
yorammi / 2repos-sync.sh
Last active January 11, 2024 07:25
Sync 2 remote repositories script - Just define the 3 variables (use export command for that!)
#!/bin/bash
# REPO_NAME=<repo>.git
# ORIGIN_URL=git@<host>:<project>/$REPO_NAME
# REPO1_URL=git@<host>:<project>/$REPO_NAME
rm -rf $REPO_NAME
git clone --bare $ORIGIN_URL
if [ "$?" != "0" ]; then
echo "ERROR: failed clone of $ORIGIN_URL"
@alex-shpak
alex-shpak / Interceptor.java
Last active March 29, 2023 21:06
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON