Skip to content

Instantly share code, notes, and snippets.

package com.gertherb.api;
import com.squareup.okhttp.internal.Base64;
import retrofit.Endpoint;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import static retrofit.RestAdapter.LogLevel.FULL;
@mr-archano
mr-archano / build.gradle
Last active August 29, 2015 14:01
crashlytics hack
...
File crashlyticsProperties = new File("${project.projectDir.absolutePath}/crashlytics.properties")
applicationVariants.all { variant ->
variant.productFlavors.each { flavor ->
def variantSuffix = variant.name.capitalize()
def generateResourcesTask = project.tasks.getByName("crashlyticsGenerateResources${variantSuffix}")
def generatePropertiesTask = task("crashlyticsGenerateProperties${variantSuffix}") << {
Properties properties = new Properties()
println "...copying apiSecret for ${variant.name}"
@mr-archano
mr-archano / 0. Auto unsubscribe facilities
Last active August 29, 2015 14:10
I didn't want to pollute the discussion started in RxAndroid/#12 (https://github.com/ReactiveX/RxAndroid/issues/12), so I drafted a solution that collects some of the neat ideas showcased in there.
// NOTE: `OperatorSubscribeUntil` class is borrowed from @dlew's PR (https://github.com/dlew/RxAndroid/blob/dlew/lifecycle-observable/rxandroid/src/main/java/rx/android/lifecycle/OperatorSubscribeUntil.java)
@mr-archano
mr-archano / build.log
Created January 19, 2015 11:15
NewRelic + Crashlytics = B O O M !
:android:newRelicDeinstrumentTask
[newrelic.info] Deinstrumenting...
:android:crashlyticsStoreDeobsAlphaDebug
:android:crashlyticsUploadDeobsAlphaDebug
:android:crashlyticsCleanupResourcesAfterUploadAlphaDebug
...removing crashlytics.properties
:android:compileAlphaDebugNdk
:android:processAlphaDebugJavaRes UP-TO-DATE
:android:validateDebugSigning
:android:packageAlphaDebug
@mr-archano
mr-archano / gist:6929c2eb002c24eb9f8f
Created May 22, 2015 13:10
Thread safe SimpleDateFormat wrapper
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
public class SimpleDateFormatThreadSafe {
private final ThreadLocal<SimpleDateFormat> localSimpleDateFormat;
@mr-archano
mr-archano / JavaAptPlugin
Created July 11, 2015 20:14
APT plugin for plain Java modules
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.plugins.ide.idea.IdeaPlugin
import org.gradle.tooling.BuildException
class JavaAptPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
def aptConfiguration = project.configurations.create 'javapt'
@mr-archano
mr-archano / giffify.sh
Last active August 29, 2015 14:24 — forked from rock3r/giffify.py
#!/bin/sh
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
# ----------------------------------------------------------------------------
#
# Based upon http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
@mr-archano
mr-archano / GradleWorkersPleaseStopTakingFocus.gradle
Last active August 29, 2015 14:25 — forked from artem-zinnatullin/GradleWorkersPleaseStopTakingFocus.gradle
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
// You can place it in the root build.gradle
allprojects {
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
}
}
@mr-archano
mr-archano / Android Lollipop Widget Tinting Guide
Last active August 29, 2015 14:25 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
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:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@mr-archano
mr-archano / dump-config.xml
Created October 15, 2012 16:14
Flex dump config file
<flex-config>
<!-- benchmark: output performance benchmark-->
<!-- benchmark usage:
<benchmark>boolean</benchmark>
-->
<compiler>
<!-- compiler.accessible: generate an accessible SWF-->
<accessible>false</accessible>
<!-- compiler.actionscript-file-encoding: specifies actionscript file encoding. If there is no BOM in the AS3 source files, the compiler will use this file encoding.-->
<!-- compiler.actionscript-file-encoding usage: