Skip to content

Instantly share code, notes, and snippets.

View Kisty's full-sized avatar

Timothy Kist Kisty

View GitHub Profile
@mrroot5
mrroot5 / export-vivaldi-settings.sh
Last active April 1, 2024 01:46
Export vivaldi settings on Linux.
# We have two options:
# compress in .tar.gz (bigger size) or .7z (about 60% less size).
# .tar.gz
#
tar -czvf vivaldi-settings.tar.gz ~/.config/vivaldi/Default/
# Explanation:
# c: create a new archive
# z: gzip
# v: verbosely list files processed
# f: use archive file or device ARCHIVE
@aballano
aballano / remove_gradle_wrapper.sh
Created November 10, 2016 10:49
Removes all gradle wrapper folders except for the specified one.
cd ~/.gradle/wrapper/dists/
find . ! -name 'gradle-2.14.1-all' -type d -depth 1 -exec rm -f -r {} +
@kaushikgopal
kaushikgopal / LogExOnlySubscriber.java
Last active February 1, 2022 16:29
RxJava log exception only subscriber
public static class LogExOnlySubscriber<T> extends Subscriber<T> {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable ex) {
Timber.e(ex, "Your RX IZ FAILING YO!");
}
@nickbutcher
nickbutcher / avd_bundle.xml
Last active December 31, 2021 01:03
An example of the Android xml bundle format for creating an AnimatedVectorDrawable. See https://plus.google.com/+NickButcher/posts/A8KKxnJdg4r
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@eygraber
eygraber / OkHttpDataSource.java
Last active September 20, 2016 10:19
Copied from DefaultHttpDataSource, but uses OkHttpClient instead of URLConnection
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;
import com.google.android.exoplayer.C;
import com.google.android.exoplayer.upstream.DataSpec;
import com.google.android.exoplayer.upstream.HttpDataSource;
import com.google.android.exoplayer.upstream.TransferListener;
import com.google.android.exoplayer.util.Assertions;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
@kaushikgopal
kaushikgopal / android_lifecycle_recommendations.md
Last active February 2, 2022 07:28
Notes on opportune moments to do "stuff" in the Android Lifecycle
  • In general you want to try and put things in onStart and onStop for logical start and stops.

Activity

onCreate

  • Dagger inject self into graph
  • setContentView(R.layout.xxx)
  • Butterknife.bind(this)
  • RxJava CompositeSubscription.add (if NON UI related work being done)
  • realm = Realm.getDefaultInstance();
@neworld
neworld / howto.md
Last active September 15, 2020 11:32
How to make faster Android build without sacrificing new api lint check

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: 'com.android.application'

android {
 compileSdkVersion 23
@jgilfelt
jgilfelt / CurlLoggingInterceptor.java
Created January 9, 2016 15:34
An OkHttp interceptor that logs requests as curl shell commands
/*
* Copyright (C) 2016 Jeff Gilfelt.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.example.mediasessioncompat;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.media.MediaDescriptionCompat;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaButtonReceiver;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat;
@ZakTaccardi
ZakTaccardi / build.gradle
Created August 26, 2015 01:24
Automatic per-variant google_services.json configurations with Gradle
//append code below to existing build.gradle
def appModuleRootFolder = '.'
def srcDir = 'src'
def googleServicesJson = 'google-services.json'
task switchToDebug(type: Copy) {
def buildType = 'debug'
description = 'Switches to DEBUG google-services.json'
from "${srcDir}/${buildType}"