Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Rijckaert timrijckaert

View GitHub Profile
@di
di / Screenshot.java
Created Feb 17, 2012
The whole screenshot class
View Screenshot.java
import java.io.File;
import java.io.IOException;
import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.RawImage;
import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
View home_page.dart
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:url_launcher/url_launcher.dart';
import 'package:intl/intl.dart';
import 'dart:async';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:share/share.dart' as sharing;
import 'package:transparent_image/transparent_image.dart';
@EarlOfEgo
EarlOfEgo / Rx2SchedulersOverrideRule.kt
Created Jan 31, 2017
A test rule for unit test to override all schedulers with trampoline
View Rx2SchedulersOverrideRule.kt
import io.reactivex.android.plugins.RxAndroidPlugins
import io.reactivex.plugins.RxJavaPlugins
import io.reactivex.schedulers.Schedulers
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
/**
* Test rule that overrides all schedulers with the trampoline scheduler.
* This means everything runs on the same thread, when using this rule
@EricKuck
EricKuck / ButterknifeConductor.kt
Last active May 9, 2019
Kotterknife(ish) view binding for Conductor controllers
View ButterknifeConductor.kt
// Largely borrowed from Jake Wharton's Kotterknife (https://github.com/JakeWharton/kotterknife)
// and paweljaneczek's PR for resetting cached views (https://github.com/JakeWharton/kotterknife/pull/37)
package com.bluelinelabs.conductor.butterknife
import android.view.View
import com.bluelinelabs.conductor.Controller
import java.util.Collections
import java.util.WeakHashMap
import kotlin.properties.ReadOnlyProperty
@NikolaDespotoski
NikolaDespotoski / RichBottomNavigationView.java
Last active Jun 11, 2019
Saving and restoring BottomNavigationView state
View RichBottomNavigationView.java
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BottomNavigationView;
@jaredsburrows
jaredsburrows / Rx1TestBase.java
Last active Jul 28, 2019
RxAndroid overriding schedulers
View Rx1TestBase.java
import org.junit.After;
import org.junit.Before;
import rx.Scheduler;
import rx.android.plugins.RxAndroidPlugins;
import rx.android.plugins.RxAndroidSchedulersHook;
import rx.schedulers.Schedulers;
/**
* JUnit Tests.
*
@timrijckaert
timrijckaert / AndroidManifest.xml
Last active May 2, 2020
Test rule that disables animations and softkeyboard before any test. Easy access function to control demo modus on API 23 and up devices
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.rijckaert.tim.disableanimations">
<!-- Place this permission in your debug folder -->
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/>
</manifest>
@airtonix
airtonix / 0.Installing Couchpotato on Ubuntu.md
Last active Mar 13, 2021
How to Install Couchpotato "The Right Way(tm)"
View 0.Installing Couchpotato on Ubuntu.md

This guide will walk you through installing couchpotato from source.

There are a few assumptions I'm making about you and your system :

  • your current user has write access to /opt/
  • virtualenv installed : sudo apt-get install python-virtualenv
  • git is installed: sudo apt-get install git
@gildor
gildor / OkHttpDownloader.kt
Last active Jun 19, 2021
Simple non-blocking extension function for OkHttp Call that wraps request to Kotlin Coroutine and saves response to File
View OkHttpDownloader.kt
import kotlinx.coroutines.experimental.*
import okhttp3.*
import okio.Buffer
import okio.Okio
import java.io.File
import java.io.IOException
/**
* Custom coroutine dispatcher for blocking calls
*/
@nomisRev
nomisRev / Example.kt
Last active Sep 13, 2021
Kotlin DI with receivers & interface delegation
View Example.kt
import arrow.core.*
import memeid.UUID
data class User(val email: String, val name: String) {
companion object
}
data class ProcessedUser(val id: UUID, val email: String, val name: String) {
companion object
}