Skip to content

Instantly share code, notes, and snippets.

View timrijckaert's full-sized avatar

Tim Rijckaert timrijckaert

View GitHub Profile
@di
di / Screenshot.java
Created February 17, 2012 17:53
The whole screenshot class
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;
@h4040
h4040 / home_page.dart
Created April 18, 2018 02:26
NewsReader
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 January 31, 2017 08:49
A test rule for unit test to override all schedulers with trampoline
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 20:30
Kotterknife(ish) view binding for Conductor controllers
// 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
@jaredsburrows
jaredsburrows / Rx1TestBase.java
Last active July 28, 2019 04:16
RxAndroid overriding schedulers
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 19:32
Test rule that disables animations and softkeyboard before any test. Easy access function to control demo modus on API 23 and up devices
<?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 March 13, 2021 14:52
How to Install Couchpotato "The Right Way(tm)"

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 June 19, 2021 07:35
Simple non-blocking extension function for OkHttp Call that wraps request to Kotlin Coroutine and saves response to File
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 September 13, 2021 22:48
Kotlin DI with receivers & interface delegation
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
}
@Aidanvii7
Aidanvii7 / NavGraph.kt
Last active October 17, 2021 12:38
Navigate with Parcelable arguments in Jetpack Compose
composable(route = "screen_1") {
Button(
onClick = {
navController.navigate(
route = "screen_2",
args = parcelableArgs {
arg { MyParcelableArgument() }
arg("named") { MyParcelableArgument() }
},
)