Skip to content

Instantly share code, notes, and snippets.

Houssem Zaier houssemzaier

Block or report user

Report or block houssemzaier

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
@houssemzaier
houssemzaier / main.kt
Created Jul 26, 2018
This sample shows replayed response (that could have a param) from an Observable Subject used like a proxy between the client and original Observable
View main.kt
import io.reactivex.Observable
import io.reactivex.subjects.PublishSubject
import java.util.*
fun main(args: Array<String>) {
val vm = VM(Repo())
vm.observableData.subscribe {
println("from sub1 $it")
}
Thread.sleep(3333)
@houssemzaier
houssemzaier / ApiResponse.java
Created May 4, 2018 — forked from AkshayChordiya/ApiResponse.java
LiveData adapter for Retrofit
View ApiResponse.java
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@houssemzaier
houssemzaier / ApiResponse.java
Created May 4, 2018 — forked from AkshayChordiya/ApiResponse.java
LiveData adapter for Retrofit
View ApiResponse.java
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
View sample_dsl_with_kotlin.kt
package com.example.hzaier.myapplicationkt.dsl
import org.junit.Test
interface Matcher<T> {
fun test(lhs: T)
infix fun or(other: Matcher<T>): Matcher<T> = object : Matcher<T> {
override fun test(lhs: T) {
@houssemzaier
houssemzaier / TestLogin.java
Created Sep 21, 2017 — forked from lparoli/TestLogin
Class example for testing a Login screen using Screen Object Pattern & JUnit4.
View TestLogin.java
package qa.com.espressospoonstructure.tests;
import org.junit.Test;
import qa.com.espressospoonstructure.screenObjects.LoginScreen;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
public class TestLoginScreen extends BaseTestCase<MainActivity> {
@houssemzaier
houssemzaier / LoginScreen.java
Last active Sep 21, 2017 — forked from lparoli/LoginScreen
Screen Object Pattern class example
View LoginScreen.java
package qa.com.espressospoonstructure.screenObjects;
import android.support.test.espresso.ViewInteraction;
import org.hamcrest.Matcher;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.scrollTo;
@houssemzaier
houssemzaier / spark.md
Created May 23, 2016 — forked from jesperfj/spark.md
Spark on Heroku
View spark.md

This guide will get you started using Spark on Heroku/Cedar. Spark is basically a clone of Sinatra for Java. 'Nuff said.

Create your app

Create a single Java main class in src/main/java/HelloWorld.java:

:::java
import static spark.Spark.*;
import spark.*;
@houssemzaier
houssemzaier / Application.groovy
Created Mar 3, 2016 — forked from ethankhall/Application.groovy
Auth0 Spring Boot Java Config
View Application.groovy
package com.example
import groovy.util.logging.Slf4j
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Import
import org.springframework.web.servlet.config.annotation.EnableWebMvc
You can’t perform that action at this time.