Skip to content

Instantly share code, notes, and snippets.

View sagix's full-sized avatar

Nicolas sagix

View GitHub Profile
@sagix
sagix / EnRetard.kt
Created December 24, 2018 10:12
En retard
View EnRetard.kt
fun en_retard() = Dialog(
NO_ONE say """
${reporter.name} vous attend à l'endroit convenu : près d'une petite maisonnette louant des barques aux touristes désireux de passer un moment romantique sur le lac.
Elle semble nerveuse...
Quand elle vous voit, un sourire soulagé détend un peu ses traits.
""".trimIndent(),
reporter say "${player.name} !",
reporter ask "Tu es en retard !" given "Ouais, ouais, je sais." then {
Dialog(
reporter say "Et tu t'en fous en plus ?",
@sagix
sagix / MutableDecoratorExtensions.kt
Created October 24, 2018 08:01
Mutable decorator with lifecyle extensions
View MutableDecoratorExtensions.kt
@file:JvmName("MutableDecoratorUtils")
package net.ilius.android.core.android
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.OnLifecycleEvent
import com.nicolasmouchel.executordecorator.MutableDecorator
View MutableDecoratorLifecycle.kt
@file:JvmName("MutableDecoratorUtils")
package com.nicolasmouchel.executordecorator.android.arch.lifecycle
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.OnLifecycleEvent
import com.nicolasmouchel.executordecorator.MutableDecorator
@Suppress("unused")
@sagix
sagix / ExecutorIdlingResource.java
Last active March 20, 2017 10:04
Handle executor idle state with Espresso and an IdlingResource
View ExecutorIdlingResource.java
import android.support.annotation.NonNull;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.IdlingResource;
import org.junit.rules.ExternalResource;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
public class ExecutorTestRule extends ExternalResource {
@sagix
sagix / RoundedShadowedLayout.java
Last active December 22, 2016 03:26
Create a layout with border radius and shadow that mask content inside the rounded rect.
View RoundedShadowedLayout.java
package com.octo.nicolasmouchel;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;