Skip to content

Instantly share code, notes, and snippets.

Peter Tackage peter-tackage

Block or report user

Report or block peter-tackage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
imminent /
Last active Dec 14, 2015
Collection of code to use the Client interface of Retrofit to use HttpUrlConnection with SharedPreferences persistent cookies.
import android.annotation.TargetApi;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.PatternMatcher;
import javax.inject.Singleton;
damianflannery / gist:5717329
Last active Dec 18, 2015
android square okhttp, mimecraft & cookies
View gist:5717329
public static int okSubmitAttachment(Context ctx, String filePath, String mimeType, String uuid) throws IOException, URISyntaxException, MalformedURLException {
int responseCode = 0;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
String baseUrl = prefs.getString("server_preference", Constants.DEFAULT_BASE_URL);
if (!(baseUrl.charAt(baseUrl.length() - 1) == '/')) {
baseUrl += "/";
stefanhoth /
Last active Dec 29, 2015
GDG Android in Berlin brainstorming session Collection of libraries that should be included as of today in a modern Android app-

#GDG Android in Berlin brainstorming session

On November 27, 2013 I was asking the brilliant Android developers at GDG Android in Berlin for their favorite libraries that make their lives easier and should be included in every newly developed app.

This is the list of libraries we collected during this 10 minute session.


orip / build.gradle
Last active Apr 19, 2016
ProGuard rules for using Dagger 1.1.0 with gradle.
View build.gradle
dependencies {
def dagger_version = "1.1.0"
compile "com.squareup.dagger:dagger:${dagger_version}"
compile "com.squareup.dagger:dagger-compiler:${dagger_version}"
swankjesse /
Created Jun 29, 2013
Demonstrate HTTP caching with OkHttp and Retrofit.
* Copyright (C) 2013 Square, 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
* Unless required by applicable law or agreed to in writing, software
pedpess /
Last active Jun 6, 2018
React Native Study Notes

React Native Study Notes

(by @pedpess)

These are my own paper version notes meeting the digital world. They are related to my learnings from 2017-18, or just stuff I thought would be nice to keep a record during the time I was grasping React Native to use in several projects of mine.

I also did a study notes about Javascript. Check it out! ;)

pedpess /
Last active Aug 26, 2018
Javascript Study Notes

Javascript Study Notes

(by @pedpess)

These are my own paper version notes meeting the digital world. They are related to my learnings from 2017-18, or just stuff I thought would be nice to keep a record during the time I was grasping some Javascript topics.

PS: Don't expect all the material here to be 100% accurate or up-to-date. If you find some part that's wrong, or missing or old, please send me a comment to fix! :)

JakeWharton /
Created May 21, 2013
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.squareup.okhttp.OkHttpClient;
* An {@link HttpStack} implementation which
* uses OkHttp as its transport.
JakeWharton /
Last active May 12, 2019
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
dlew / themes-debug.xml
Last active Jul 20, 2019
With the new theming in AppCompat, a lot of assets are tinted automatically for you via theme attributes. That has often led me to wonder "where the hell did this color come from?" You can replace your normal theme with this debug theme to help figure out the source of that color.
View themes-debug.xml
<!-- You can change the parent around to whatever you normally use -->
<style name="DebugColors" parent="Theme.AppCompat">
<!-- System colors -->
<item name="android:windowBackground">@color/__debugWindowBackground</item>
<item name="android:colorPressedHighlight">#FF4400</item>
<item name="android:colorLongPressedHighlight">#FF0044</item>
<item name="android:colorFocusedHighlight">#44FF00</item>
<item name="android:colorActivatedHighlight">#00FF44</item>
You can’t perform that action at this time.