Skip to content

Instantly share code, notes, and snippets.

View polbins's full-sized avatar
🏔️

polbins polbins

🏔️
View GitHub Profile
@mugifly
mugifly / magnum-ci-build-android-apk-and-post-to-slack.md
Last active November 24, 2017 11:40
Build of Android Studio Project and Post the apk to Slack from Magnum CI

Build of Android Studio Project and Post the apk to Slack from Magnum CI

  • Build the Android Studio Project (Gradle Project) which exist on your Git repository.
  • Upload the generated apk file to Slack.

Basic Setup

  • Name: YOUR-REPOSITORY-NAME
  • Repository URL: git@github.com:XXX/YYY.git
  • Provider: Github
  • Source control: Git
  • Project type: Generic
@polbins
polbins / README.md
Last active September 6, 2019 11:08
Android Response Caching using Retrofit 1.9 + OkHttp 2.2

Android REST Controller with Cache-Control

Android REST Controller with Simple Cache Control Headers using Retrofit 1.9.0 + OkHttp 2.2.0

@TouchBoarder
TouchBoarder / MainActivity.java
Created April 9, 2016 12:15 — forked from lisawray/MainActivity.java
Vector drawables from XML with the Android support library 23.3.0
package com.xwray.vectorbinding;
import android.databinding.BindingAdapter;
import android.databinding.DataBindingUtil;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
@ultraon
ultraon / build.gradle
Last active August 19, 2020 18:10
Good example of the merged Jacoco code covarage Gradle configuration
apply plugin: 'com.android.application'
apply from: "$rootDir/coverage.gradle"
//...
android {
//...
buildTypes {
//...
debug {
@andkon
andkon / outdoors.md
Last active September 22, 2020 18:21
Toronto Outdoors

Spring/summer/fall (in order of distance)

  • Daytrip list
  • Tobermory swimming holes/grotto
  • Bruce Peninsula National Park - you can book backcountry sites here. Very chill hike, but really beautiful. I came from the east parking lot and then got a ride back to my car, but you could definitely just park at the main campground, camp at site HD6 (or thereabouts), and then hike back the next day, as it was only about 12km from there to the main camp.
  • Algonquin Provincial Park - I've only ever carcamped here, but there's a loo
@yangweigbh
yangweigbh / NetworkEventProvider.java
Last active January 18, 2021 10:35
Class to listen to network change
public interface NetworkEventProvider {
void setListener(Listener listener);
interface Listener {
/**
* @param networkStatus {@link com.birbit.android.jobqueue.network.NetworkUtil.NetworkStatus}
*/
void onNetworkChange(@NetworkUtil.NetworkStatus int networkStatus);
}
}
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active June 28, 2022 07:16
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'firstname.lastname@gov.bc.ca'
    
@nesquena
nesquena / PatternEditableBuilder.java
Last active October 21, 2022 10:20
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
package statemachine
import debug
import fail
import io.reactivex.Observable
import kotlinx.coroutines.experimental.channels.Channel
import kotlinx.coroutines.experimental.channels.produce
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.launch
import kotlinx.coroutines.experimental.runBlocking
@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